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. Advertisements

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:
    481
    srinivas moorthy
    Dec 9, 2003
  2. Patrice
    Replies:
    3
    Views:
    7,342
    Michael D. Long
    Sep 22, 2004
  3. Michael D. Long

    Re: Opening / Closing SQL Server connections

    Michael D. Long, Sep 22, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    650
    Michael D. Long
    Sep 24, 2004
  4. darrel
    Replies:
    7
    Views:
    555
    darrel
    Oct 15, 2004
  5. bannaman

    Closing SQL Connections

    bannaman, Mar 21, 2006, in forum: ASP .Net
    Replies:
    10
    Views:
    5,427
    Juan T. Llibre
    Mar 21, 2006
  6. R
    Replies:
    1
    Views:
    3,012
  7. jobs
    Replies:
    2
    Views:
    1,136
  8. Austin 7873
    Replies:
    5
    Views:
    412
    Eric Hodel
    Jan 27, 2007
Loading...