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.

Example of how to run event_loop in separate thread for using the `timed_window()` method

See original GitHub issue

Hi,

Could you please add an example of how to run an event loop in a separate thread so that one can use the timed_window() and delay() methods?

The only reference I found is that it works in a Jupyter notebook because that already has an event loop running in the background. This doesn’t help me as I’m not running in a Jupyter notebook.

I’m using asyncio in Python 3.6 and mostly that’s working fine but I can’t get the timed_window() function to work.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
mrocklincommented, Oct 14, 2017

Maybe @CJ-Wright or @jrmlhermitte has time here?

1reaction
CJ-Wrightcommented, Oct 14, 2017

I don’t have a ton of experience with async programming, but I can try look at an example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Event Loop — Python 3.11.1 documentation
The event loop is the core of every asyncio application. Event loops run asynchronous tasks and callbacks, perform network IO operations, and run...
Read more >
Threaded Asynchronous Magic and How to Wield It - Medium
Running a loop in a different thread​​ new_event_loop() . The idea is to spawn a new thread, pass it that new loop and...
Read more >
TkDocs Tutorial - Event Loop
Event Loop : Part of a Modern Tk Tutorial for Python, Tcl, Ruby, and Perl. ... running the GUI and event handlers in...
Read more >
asyncio event loop in separate thread and consume queue ...
My approach is to kick off a separate thread and pass a queue to the event loop within that thread.
Read more >
Python asyncio event loop in a separate thread - GitHub Gist
This gist shows how to run asyncio loop in a separate thread. It could be useful if you want to mix sync and...
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