This repository was archived by the owner on Mar 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +28
-3
lines changed
Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,27 @@ response.
77
88Sniffing (when requested) is also done via a scheduled coroutine.
99
10- Example::
10+ Example for python 3.5+
11+
12+ .. code-block:: python
13+
14+ import asyncio
15+ from elasticsearch_async import AsyncElasticsearch
16+
17+ client = AsyncElasticsearch(hosts=['localhost', 'other-host'])
18+
19+ async def print_info():
20+ info = await client.info()
21+ print(info)
22+
23+ loop = asyncio.get_event_loop()
24+ loop.run_until_complete(print_info())
25+ loop.run_until_complete(client.transport.close())
26+ loop.close()
27+
28+ Example for python 3.4
29+
30+ .. code-block:: python
1131
1232 import asyncio
1333 from elasticsearch_async import AsyncElasticsearch
@@ -25,7 +45,9 @@ Example::
2545 loop.close()
2646
2747
28- Example with SSL Context::
48+ Example with SSL Context
49+
50+ .. code-block:: python
2951
3052 import asyncio
3153 from elasticsearch_async import AsyncElasticsearch
@@ -61,10 +83,13 @@ used to pass in an event loop you wish the client to use. By default
6183Installation
6284------------
6385
64- ``elasticsearch-async`` is available via PyPI so you can install it using pip::
86+ ``elasticsearch-async`` is available via PyPI so you can install it using pip
87+
88+ .. code-block:: bash
6589
6690 pip install elasticsearch-async
6791
92+
6893License
6994-------
7095
You can’t perform that action at this time.
0 commit comments