Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Improved documentation of #shutdown and when to use it. Fixes #20

  • Loading branch information...
commit 99946f010dd4212933e69c869604c12e152153c1 1 parent 49ec8eb
Eric Hodel authored March 22, 2012
8  README.rdoc
Source Rendered
@@ -45,8 +45,12 @@ connection is kept alive between requests:
45 45
     # perform the POST, the URI is always required
46 46
     response = http.request post_uri, post
47 47
 
48  
-Please see the documentation for +Net::HTTP::Persistent+ for more information,
49  
-including how to handle SSL connections.
  48
+    # if you are done making http requests, or won't make requests for several
  49
+    # minutes
  50
+    http.shutdown
  51
+
  52
+Please see the documentation on Net::HTTP::Persistent for more information,
  53
+including SSL connection verification, header handling and tunable options.
50 54
 
51 55
 == INSTALL:
52 56
 
12  lib/net/http/persistent.rb
@@ -161,6 +161,18 @@
161 161
 # The method of determining if the resource was created or not is unique to
162 162
 # the particular service you are using.  Of course, you will want to add
163 163
 # protection from infinite looping.
  164
+#
  165
+# === Connection Termination
  166
+#
  167
+# If you are done using the Net::HTTP::Persistent instance you may shut down
  168
+# all the connections in the current thread with #shutdown.  This is not
  169
+# recommended for normal use, it should only be used when it will be several
  170
+# minutes before you make another HTTP request.
  171
+#
  172
+# If you are using multiple threads, call #shutdown in each thread when the
  173
+# thread is done making requests.  If you don't call shutdown, that's OK.
  174
+# Ruby will automatically garbage collect and shutdown your HTTP connections
  175
+# when the thread terminates.
164 176
 
165 177
 class Net::HTTP::Persistent
166 178
 

0 notes on commit 99946f0

Please sign in to comment.
Something went wrong with that request. Please try again.