xactor icon indicating copy to clipboard operation
xactor copied to clipboard

How to have multiple actors subscribe to the same task and not duplicate work?

Open ilmoi opened this issue 3 years ago • 0 comments

Currently if I spawn multiple actors:

let _daddr = DownloadActor::start_default().await.unwrap();
let _daddr2 = DownloadActor::start_default().await.unwrap();

and then publish a job:

Broker::from_registry().await.unwrap().publish(msg)

the effect I get is that each actor picks up the job. What I'd like is just one of them to pick up the job, like you'd have with a normal FIFO queue system.

Is that possible with xactor?

ilmoi avatar Jun 27 '21 13:06 ilmoi