Replies: 1 comment
-
Before anything, thanks for continuing to improve this library! I'm particularly interested in this feature as I got a use case for it at work that is currently being handled (poorly) with celery that I would love to replace. At least from my perspective working with SQS and on
Also, I was wondering with this feature, would we be able to define a single task that reads from a number of queues like so? queues = [broker.extra_queue(...) i for range(1, 10)]
@broker.task.queues(*queues)
async def task() :.. it could simplify the definition for having a task consuming from a number of queues a lot. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Abstract
Currently our brokers only leverage one queue and all tasks are sent in a single queue. The idea is to make it possible to assign different queues to tasks and being able to send tasks and read from multiple queues.
Solution
Currently there's a PR #418 that adds ability to add new methods to
broker.task
. We can make use of this feature in order to achieve the following API:The question is how to specify queues, because queue API is different to all brokers.
One of possible solutions is to add function
extra_queue
method to broker, that returns a genericExtraQueue
object which can be used by the same broker to change task's destination.Here's a usage example:
Questions
ExtraQueue
class. (or return strings)extra_queue
toextra_read_queue
andextra_write_queue
Beta Was this translation helpful? Give feedback.
All reactions