Skip to content

Commit 88f2c1f

Browse files
docs(readme): example snippet for client context manager (#79)
1 parent 95a6640 commit 88f2c1f

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
@@ -361,6 +361,16 @@ client.with_options(http_client=DefaultHttpxClient(...))
361361

362362
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.
363363

364+
```py
365+
from asktable import Asktable
366+
367+
with Asktable() as client:
368+
# make requests here
369+
...
370+
371+
# HTTP client is now closed
372+
```
373+
364374
## Versioning
365375

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