<div dir="ltr">One thing on Charles, if your testing ruby/pry/irb code you may need to connect through the Charles proxy e.g. Nokogiri request<div></div><div class="markdown-here-wrapper" id="markdown-here-wrapper-273163" style="font-size:1em;font-family:Helvetica,arial,freesans,clean,sans-serif;color:rgb(34,34,34);background-color:rgb(255,255,255);border:none;line-height:1.2">
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;overflow:auto;margin:1em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;white-space:pre;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block;padding:0.5em;color:rgb(51,51,51);background-color:rgb(248,248,255);background-repeat:initial initial">doc = Nokogiri::HTML(open("<a href="http://www.threescompany.com/">http://www.threescompany.com/</a>", :proxy => 'http://localhost:8888'))</code></pre>

</div><div></div></div><div class="gmail_extra"><br clear="all"><div><div>-- </div><div>David Burrows</div><div>079 1234 2125</div><div>@dburrows</div><div><br></div><div><a href="http://www.designsuperbuild.com/" target="_blank">http://www.designsuperbuild.com/</a> | @dsgnsprbld</div>
</div>
<br><br><div class="gmail_quote">On Tue, Feb 5, 2013 at 11:45 AM, JB Steadman <span dir="ltr"><<a href="mailto:jb@pivotallabs.com" target="_blank">jb@pivotallabs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">+1 for Charles. Especially useful for mobile development when you want to simulate slower connections.</div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Tue, Feb 5, 2013 at 11:31 AM, David Burrows <span dir="ltr"><<a href="mailto:david@designsuperbuild.com" target="_blank">david@designsuperbuild.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I use Charles (<a href="http://www.charlesproxy.com/" target="_blank">http://www.charlesproxy.com/</a>) to simulate slow connections, you can just add a latency in to the throttling settings. There's also Apple's Network Link Conditioner, used to come with XCode but not any more, think you need to download the OS X hardware tools from Apple so you may need a dev center login.<span><font color="#888888"><br>


</font></span></div><div class="gmail_extra"><span><font color="#888888"><br clear="all"><div><div>-- </div><div>David Burrows</div><div>079 1234 2125</div><div>@dburrows</div><div><br></div><div><a href="http://www.designsuperbuild.com/" target="_blank">http://www.designsuperbuild.com/</a> | @dsgnsprbld</div>


</div></font></span><div><div>
<br><br><div class="gmail_quote">On Tue, Feb 5, 2013 at 11:13 AM, Tom Stuart <span dir="ltr"><<a href="mailto:tom@codon.com" target="_blank">tom@codon.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div>On 5 Feb 2013, at 11:07, Andrew Stewart wrote:<br>
> To test that it was working, I added a `sleep 3` inside the `request.on_complete` block (lines 17-19).  I then gave it an array of 40 URLs of assets on Amazon S3 and ran it.<br>
><br>
> I was expecting this to take ~40s but it actually took 120s.  What am I doing wrong?<br>
<br>
</div>Typhoeus uses non-blocking I/O to perform simultaneous requests — it's still single-threaded, like EventMachine. If you sleep the (only) interpreter thread 40 times, you'll wait 120 seconds regardless of any I/O you're doing.<br>



<br>
If you want to test it for real, you'll need to arrange for each HTTP request to actually take 3 seconds to return. Maybe write a little Rack app that sleeps for 3 seconds before responding, run it locally in a multithreaded application server (e.g. Puma), and point your code at that instead of S3?<br>



<br>
Cheers,<br>
-Tom<br>
<div><div>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</div></div></blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div dir="ltr"><div>JB Steadman</div>Pivotal Labs - London<div>mobile: <a href="tel:%2B44%20%280%29%207450%20418%20409" value="+447450418409" target="_blank">+44 (0) 7450 418 409</a></div>
</div>
</font></span></div>
</blockquote></div><br></div>