Skip to content

Kicking tasks from a task in another broker. #80

Closed Answered by s3rius
lembregtse asked this question in Q&A
Discussion options

You must be logged in to vote

I guess, you can add startup of another broker in your primary one.

Like this:

from taskiq import InMemoryBroker, TaskiqEvents, TaskiqState

broker1 = InMemoryBroker()
broker2 = InMemoryBroker()


@broker1.on_event(TaskiqEvents.WORKER_STARTUP)
async def run_another_broker(_: TaskiqState):
    await broker2.startup()

Replace inmemory brokers with your own.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@s3rius
Comment options

@s3rius
Comment options

Answer selected by lembregtse
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