Reputation: 389
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
?
Upvotes: 1
Views: 285
Reputation: 22134
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?
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).
Upvotes: 1