Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to listen on event whilst running different loop at same time #15

Open
Miniontoby opened this issue Oct 22, 2022 · 0 comments
Open

Comments

@Miniontoby
Copy link

So I am working on this thingy where I use my MIDI Keyboard with drumpads as a kind of streamdeck but than different.

I need to use a:

async def mainloop():
    running = True
    while running:
        for msg in midi_in.iter_pending():
            # do stuff here with msg

What ever I try, it doesn't want to run both at the same time

Here is a list with things I tried:

  • using loop.create_task(mainloop())
  • threading loop.run_forever and running asyncio.run_coroutine_threadsafe(mainloop(), loop)

But yeah I just need to listen on the CurrentProgramSceneChanged and CurrentSceneCollectionChanged events and the events from my midi input.

Please help me out!

P.s. There is some kind of pressure on this, cause it is needed pretty soon!

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

No branches or pull requests

1 participant