Skip to content

Commit 790f1d3

Browse files
docs(readme): example snippet for client context manager (#464)
1 parent 155b381 commit 790f1d3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,16 @@ client.with_options(http_client=DefaultHttpxClient(...))
402402

403403
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
404404

405+
```py
406+
from orb import Orb
407+
408+
with Orb() as client:
409+
# make requests here
410+
...
411+
412+
# HTTP client is now closed
413+
```
414+
405415
## Versioning
406416

407417
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

0 commit comments

Comments
 (0)