elasticsearch-py-async | py based on python 's asyncio module | Reactive Programming library
kandi X-RAY | elasticsearch-py-async Summary
kandi X-RAY | elasticsearch-py-async Summary
This is an adapter for `elasticsearch-py`_ providing a transport layer based on Python’s `asyncio`_ module. All API calls now return a future wrapping the response. Sniffing (when requested) is also done via a scheduled coroutine. Example for python 3.5+. Example for python 3.4. Example with SSL Context. `AsyncElasticsearch` introduces one extra parameter `loop` which can be used to pass in an event loop you wish the client to use. By default `asyncio.get_event_loop()` will be used.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Perform a HTTP request
- The main loop
- Get a connection
- Mark a connection as dead
- Detect hosts
- Get sniff data
- Set connection pool
elasticsearch-py-async Key Features
elasticsearch-py-async Examples and Code Snippets
Community Discussions
Trending Discussions on elasticsearch-py-async
QUESTION
I am trying to use elasticsearch_async (repo) with tornado 6.0.3.
From what I understood going through the code, if I use AsyncElasticSearch
and pass the current tornado ioloop
, it will work. Can someone confirm or point to an example?
My second question is - I see AsyncElasticSearch
uses AIOHttpConnection
(code) internally as the default connection_class
. Do I need to create a new connection_class
adapter to pass to the connection_class
which uses tornado's AsyncHttpClient
or will the tornado work seamlessly with AIOHttpConnection
?
ANSWER
Answered 2019-Dec-22 at 19:23From what I understood going through the code, if I use AsyncElasticSearch and pass the current tornado ioloop, it will work. Can someone confirm or point to an example?
AsyncElasticSearch wants an asyncio
event loop, not a Tornado IOLoop. But in Tornado 6 the Tornado IOLoop is just a wrapper around the asyncio event loop, so if you just ignore all of this and use the defaults everything should just work.
Do I need to create a new connection_class adapter to pass to the connection_class which uses tornado's AsyncHttpClient or will the tornado work seamlessly with AIOHttpConnection?
No. Just let AsyncElasticSearch use aiohttp even if other parts of your application are using AsyncHTTPClient. It should all just work together (although I haven't actually tried this combination).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install elasticsearch-py-async
code-block:: bash pip install elasticsearch-async
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page