|
|
|
|
|
by arynda
1369 days ago
|
|
That's cool. I've been thinking through a similar design. Would this be an accurate description of your approach? queues hold jobs, the scheduler/dispatcher handles load-balancing and rate-limiting, pushing jobs down to workers only when flow-control criteria is met? ┌────────┐ ┌─────────┐
│ queueA ├──┐ ┌──┤worker1 │
└────────┘ │ │ └─────────┘
│ │
┌────────┐ ├───────────┴┐ ┌─────────┐
│ queueB ├──┤dispatcher ├─┤worker2 │
└────────┘ ├───────────┬┘ └─────────┘
│ │
┌────────┐ │ │ ┌─────────┐
│ queueC ├──┘ └──┤workerN │
└────────┘ └─────────┘
|
|
My system supports as many dispatchers as you want, which is a good addition but makes the logic more complex as you have to be careful with locks so you don't schedule jobs many times, for example.
My system also implements retry logic, and a bunch of other stuff, but that isn't absolutely required either.