How can I create a queue with multiple workers?

前端 未结 2 648
生来不讨喜
生来不讨喜 2021-01-31 06:19

I want to create a queue where clients can put in requests, then server worker threads can pull them out as they have resources available.

I\'m exploring how I could do

2条回答
  •  [愿得一人]
    2021-01-31 06:59

    This question is pretty old but in case someone makes it here anyway...

    Since mid 2015 Firebase offers something called the Firebase Queue, a fault-tolerant multi-worker job pipeline built on Firebase.

    Q: Is this a good design that will integrate well into the upcoming security plans?

    A: Your design suggestion fits perfectly with Firebase Queue.

    Q: How do I get all the servers to listen to the queue, but only one to pick up each request?

    A: Well, that is pretty much what Firebase Queue does for you!

    References:

    • Introducing Firebase Queue (blog entry)
    • Firebase Queue (official GitHub-repo)

提交回复
热议问题