Skip to content

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

@Miniontoby

Description

@Miniontoby

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions