postaljs / postal.js

JavaScript pub/sub library supporting advanced subscription features, and several helpful add-ons.
http://ifandelse.com
MIT License
2.83k stars 193 forks source link

Competing consumers #167

Open johnknoop opened 7 years ago

johnknoop commented 7 years ago

Hi!

I am using Postal.js to write an in-browser demonstration of a messaging system to represent our current dataflow. But one thing I fail to demonstrate is the distribution of load using whats commonly knows as competing consumers.

Say that we have a channel of messages representing cars to be washed. If cars appear more frequent than our subscriber can handle, we want to add a new subscriber. However, we don't want the same cars to end up in both carwashed (which is what happens in Postal when I simply add a new subscriber).

Is this possible using Postal, or maybe using one of the plugins?

Thanks

pinoniq commented 7 years ago

Personally, I don't believe this is what postal is all about.

Look into the Chain of Resposibility pattern.