Skip to content

Commit 45d1e79

Browse files
committed
Add documentation about the new disconnect() method
1 parent e9cee62 commit 45d1e79

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.rst

+8
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ The first thing you need to do is to connect with PuppetDB:
9797
>>> from pypuppetdb import connect
9898
>>> db = connect()
9999
100+
Once you're all done with requests to PuppetDB, you can explicitly close all
101+
HTTP connections. This can be useful if you made those connections through a
102+
tunnel, which might be tracking open connections:
103+
104+
.. code-block:: python
105+
106+
>>> db.disconnect()
107+
100108
You can also use the `with` statement to enclose the work done on PuppetDB.
101109
This will ensure that all HTTP connections are closed explicitly when we're
102110
done:

docs/quickstart.rst

+8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ The first thing you need to do is to connect with PuppetDB:
1515
>>> from pypuppetdb import connect
1616
>>> db = connect()
1717
18+
Once you're all done with requests to PuppetDB, you can explicitly close all
19+
HTTP connections. This can be useful if you made those connections through a
20+
tunnel, which might be tracking open connections:
21+
22+
.. code-block:: python
23+
24+
>>> db.disconnect()
25+
1826
You can also use the `with` statement to enclose the work done on PuppetDB.
1927
This will ensure that all HTTP connections are closed explicitly when we're
2028
done:

0 commit comments

Comments
 (0)