Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Using with Quamash #8

Closed
danieljfarrell opened this issue Mar 5, 2019 · 4 comments
Closed

Using with Quamash #8

danieljfarrell opened this issue Mar 5, 2019 · 4 comments

Comments

@danieljfarrell
Copy link

I use this project a lot recently with Jupyter notebooks for testing async code, thanks! Hope it’s OK to leave a question here?

In your readme it says this probably will not work with quamash events loops, I was wondering if you could let me know more about that, such as what’s the main difficult?

I am using Quamash for a desktop QT application and I’m coming up against the classic problem of interoperability with legacy code that I cannot change. I need to call an ‘async def’ function and waiting for it to complete inside a ‘def’ function.

Do you think nest_asyncio could help? Or do you think it’s not worth it because it may introduce really hard to track down bugs?

@erdewit
Copy link
Owner

erdewit commented Mar 5, 2019

Check out ib_insync.util.useQt().

It's made to be used with nest_asyncio.

@danieljfarrell
Copy link
Author

Thanks!

Does this replace Quamash? I’m not too sure the use case for this. How would I use this in my QT app?

@erdewit
Copy link
Owner

erdewit commented Mar 5, 2019

Yes, it replaces quamash. Just call useQt() and start the asyncio loop.

There's a demo here: https://github.com/erdewit/ib_insync/blob/master/examples/qt_ticker_table.py

@erdewit erdewit closed this as completed Mar 5, 2019
@danieljfarrell
Copy link
Author

Perfect! Will try that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants