question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Asyncio.run Not Supported

See original GitHub issue

I tried to use the Python 3.7 approach for asyncio via asyncio.run() and not loop.run_until_complete(). This produces the following error:

RuntimeError: Task <Task pending coro=<query_elasticsearch() running at <ipython-input-10-b627b3d0f9d9>:23> cb=[as_completed.<locals>._on_completion() at /miniconda3.7/lib/python3.7/asyncio/tasks.py:520]> got Future <Task pending coro=<AsyncTransport.main_loop() running at /lib/python3.7/site-packages/elasticsearch_async/transport.py:143>> attached to a different loop

If this is not a bug but just not supported yet, is there plans to include this? Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sethmlarsoncommented, Mar 16, 2020

Hey all! I’m going to be doing an overhaul of the elasticsearch-async package to add async/await (instead of using yield from) while updating the API to 7.x. That’s a big chunk of work so won’t be coming “soon” but is something that’s on the radar.

0reactions
sethmlarsoncommented, Jun 23, 2020

asyncio.run() is supported by elasticsearch[async] without requiring the client to be defined inside the event loop.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"asyncio.run() cannot be called from a running event loop ...
The asyncio.run() documentation says: This function cannot be called when another asyncio event loop is running in the same thread.
Read more >
Developing with asyncio — Python 3.11.1 documentation
Asynchronous programming is different from classic “sequential” programming. This page lists common mistakes and traps and explains how to avoid them.
Read more >
Asyncio is not supported for python console with python 3.8
Setup Python 3.8 interpreter · Go to File | Settings | Build, Execution, Deployment | Console | Python Console and add to the...
Read more >
Python Asyncio Part 5 – Mixing Synchronous and ...
You can't run async code unless you have an event loop to run it in (without implementing some special work-around involving an object...
Read more >
Python Asyncio: The Complete Guide
Error 1: Trying to Run Coroutines by Calling Them; Error 2: Not Letting ... Next, let's consider asynchronous programming support in Python.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found