Skip to content
Discussion options

You must be logged in to vote

Ok got it - the point was mentionned indeed that for enqueue function:

Though this isn't async, it should be awaited as it returns an object that should be.

So the working way for me was the addition of loop.rununtilcomplete() available in the code of my mqtt listener.

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

[...]

def enqueue_task(generic_topic: str, board_id: UUID | None, payload: bytes) -> None:
    if "telemetry" in generic_topic:
        worker_mqtt_telemetry = get_worker(settings.WORKER_MQTT_TELEMETRY_QUEUE)
        t = loop.run_until_complete(
            worker_mqtt_telemetry.enqueue_unsafe(
                "mqtt_listener_telemetry_callback_task",
         …

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@Graeme22
Comment options

@nsteinmetz
Comment options

@nsteinmetz
Comment options

Comment options

You must be logged in to vote
1 reply
@nsteinmetz
Comment options

Answer selected by nsteinmetz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants