httpclient gem -- closing connections

Discussion in 'Ruby' started by Jonathan Rochkind, Nov 30, 2010.

  1. Anyone use the httpclient gem?

    It keeps http connections where the server allows it open, to allow
    reuse of connections, which is great for efficiency.

    But I'm confused about if I _have_ to make sure to manually close them
    all when I'm done.

    If I don't ever close them, and just let the object be (eventually, who
    knows when) garbage collected... is this bad? What will happen to all
    my connections?

    If I do need to close them all... what's the best way to do that? That
    makes my code a lot more complicated, as I need to make sure to put in a
    hook at the end of every (in this case Rails) action that knows about
    any outstanding http clients and closes all their connections.

    Any advice appreciated. I wasn't able to find any listserv or author
    contact address specifically for this gem.

    Jonathan

    --
    Posted via http://www.ruby-forum.com/.
     
    Jonathan Rochkind, Nov 30, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Do
    Replies:
    2
    Views:
    366
    srinivas moorthy
    Dec 9, 2003
  2. Patrice
    Replies:
    3
    Views:
    7,127
    Michael D. Long
    Sep 22, 2004
  3. R
    Replies:
    1
    Views:
    2,933
  4. jobs
    Replies:
    2
    Views:
    897
  5. Austin 7873
    Replies:
    5
    Views:
    191
    Eric Hodel
    Jan 27, 2007
Loading...

Share This Page