SGrondin / bottleneck

Job scheduler and rate limiter, supports Clustering
MIT License
1.82k stars 75 forks source link

Priorities on the cluster #163

Open denis-osipov opened 4 years ago

denis-osipov commented 4 years ago

Hi! Thanks for bottleneck:)

I'd like to use priority on the whole cluster. Docs says that I can't:)

Priorities are local. A higher priority job will run before a lower priority job on the same limiter. Another limiter on the cluster might run a lower priority job before our higher priority one.

You must work around these limitations in your application code if they are an issue to you. The publish() method could be useful here.

Could you answer a couple of questions?

  1. How I should use publish() to make priorities work on the whole cluster?

  2. What does it mean:

    Bottleneck will attempt to spread load evenly across limiters.

    Does it use weight to determine load? If it does, can I use weights for my case? For example, If I'll set weight and priority to 0 for some task, will it be queued ahead of other tasks on the cluster?