From: Tony Arcieri Date: 2008-02-12T13:04:30+09:00 Subject: Re: Rev/actor TCP monkey patching ------=_Part_24876_18053602.1202789070798 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Feb 11, 2008 4:26 PM, fedzor wrote: > Short and sweet - > > How exactly does one monkey patch Rev's TCP over Net::HTTP-s? > I probably should've mentioned this up front, but you can save yourself a lot of grief by just using Revactor: >> require 'revactor' => true >> response = Revactor::HttpClient.get("https://www.google.com") => #, @status=200, @reason="OK", @version="HTTP/1.1", @content_length=nil, @chunked_encoding=true, @header_fields={"Cache-Control"=>"private", "Set-Cookie"=>"PREF=ID=b7f27e80b36a740b:TM=1202788671:LM=1202788671:S=CIZI75tKEMuS7q3X; expires=Thu, 11-Feb-2010 03:57:51 GMT; path=/; domain=.google.com", "Server"=>"gws", "Transfer-Encoding"=>"chunked", "Date"=>"Tue, 12 Feb 2008 03:57:51 GMT", "Connection"=>"Close"}, @content_type="text/html; charset=ISO-8859-1"> >> response.body => "Google ... That's it. Just grab the Rev and Revactor svn repositories, "rake gem" in both, and install the gems. You get all the benefits of an evented HTTP client without the inversion-of-control headaches typically associated with evented programming. -- Tony Arcieri ClickCaster, Inc. tony@clickcaster.com ------=_Part_24876_18053602.1202789070798--