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.

Event loop integration

See original GitHub issue

When I’m using a Julia library that starts a loop with @async, the python REPL will never yield to it. It seems like we need to insert a Main.eval("yield()") into the python repl loop. Could be an easy PR, but I’m not really sure where that would go!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
SimonDanischcommented, Sep 17, 2019

Btw, after quite a bit of fiddling, this was the only solution that worked for me:

import asyncio, itertools
async def julia_yielder():
    for i in itertools.count():
        Main.eval("yield()")
        await asyncio.sleep(1/30)
        
asyncio.ensure_future(julia_yielder())

No idea why the internet is full of 1 mio solutions, that all don’t seem to work^^

0reactions
tkfcommented, Oct 6, 2019

It’s not possible. Event loop in Python is optional. Since various different libraries implement their own event loop, you have to use a specific entry point to launch a background task for each library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Integrating with GUI event loops — IPython 8.7.0 documentation
To make IPython GUI event loop integration occur automatically at every startup, set the c.InteractiveShellApp.gui configuration key in your IPython profile ( ...
Read more >
3.5. Event loop integration - Daniel P. Berrange
Event loop integration. The purpose of the libvirt event loop APIs is so that libvirt can be easily integrated into event driven applications,...
Read more >
Event Loop :: SmallRye documentation
SmallRye Fault Tolerance provides an API to integrate with event loops used in non-blocking runtimes. This integration API comes from the core module...
Read more >
UnknownBackend: No event loop integration for u'inline' when ...
If you are running matplotlib on osx this helped resolve my problem: I upgraded to matplotlib-2.2.0 by now there is a new version...
Read more >
Rethinking event loop integration for libraries - Stefan Hajnoczi
Rethinking event loop integration for libraries. APIs for operations that take a long time are often asynchronous so that applications can ...
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