apalis-dev / apalis-dev/apalis

[Feature]: partitions, virtual queues by some key

オープン
#718 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Rust
スター
1.4k
フォーク
92
PR マージ指標
30日以内にマージされた PR はありません

説明

### Is your feature request related to a problem?

All changes related to one entity are ordered and should be executed in the same order to avoid race conditions

I am looking for something similar to Kafka’s key, meaning the ability to ensure ordering within a partition.

It would be great if Apalis allowed only one active job for a particular key.

For example, all jobs related to `order 123` should be executed sequentially, which would guarantee that jobs do not overwrite each other’s results.

### Describe the solution you'd like

```
WorkerBuilder::new("emails")
.backend(storage)
.parition_by(|job: &SendEmail| job.account_id)
```
Backend picks next job taking partition key into account + skips parition keys which currently are locked.

### Describe alternatives you've considered

_No response_

### Use case

As I mentioned before, all changes related to one entity are ordered and should be executed in the same order to avoid race conditions

### Additional context

_No response_

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。