File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,32 @@ You can find some examples [here](https://github.com/typesense/typesense-python/
1616
1717See detailed [ API documentation] ( https://typesense.org/api ) .
1818
19+ ## Async usage
20+
21+ Use ` AsyncClient ` when working in an async runtime:
22+
23+ ``` python
24+ import asyncio
25+ import typesense
26+
27+
28+ async def main () -> None :
29+ client = typesense.AsyncClient({
30+ " api_key" : " abcd" ,
31+ " nodes" : [{" host" : " localhost" , " port" : " 8108" , " protocol" : " http" }],
32+ " connection_timeout_seconds" : 2 ,
33+ })
34+
35+ print (await client.collections.retrieve())
36+ await client.api_call.aclose()
37+
38+
39+ if __name__ == " __main__" :
40+ asyncio.run(main())
41+ ```
42+
43+ See ` examples/async_collection_operations.py ` for a fuller async walkthrough.
44+
1945## Compatibility
2046
2147| Typesense Server | typesense-python |
You can’t perform that action at this time.
0 commit comments