Skip to content

Commit 8072483

Browse files
docs(readme): example snippet for client context manager (#464)
1 parent 3588964 commit 8072483

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,16 @@ client.with_options(http_client=DefaultHttpxClient(...))
425425

426426
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.
427427

428+
```py
429+
from orb import Orb
430+
431+
with Orb() as client:
432+
# make requests here
433+
...
434+
435+
# HTTP client is now closed
436+
```
437+
428438
## Versioning
429439

430440
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)