apalis-dev / apalis-dev/apalis

[Feature]: partitions, virtual queues by some key

Đang mở
#718 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Rust
Star
1.4k
Fork
92
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.