nicholassm / disruptor-rs

Low latency inter-thread communication library in Rust inspired by the LMAX Disruptor.
MIT License
618 stars 18 forks source link

How to build a pipeline workflow in the current structure? #10

Closed lluckydog closed 4 months ago

lluckydog commented 4 months ago

Hi, dear author! I'm impressed by the good performance of this repo. However, I get a little confused when I am building my own work. Here is the problem: I want to build a pipeline workflow with disruptor. In the pipeline, a thread will work as both producer and consumer to the job. Is there any good idea how to build this kind of work? Thank you very much!

Yours, danny

nicholassm commented 4 months ago

Hi Danny,

Yes, absolutely! Check out the tests in lib.rs - there's an example of a pipeline where a consumer is also a producer. Note, that the pipeline has to be constructed in reverse starting with the end consumer.

Kind regards, Nicholas