Hello,
How would I limit the amount of items of a particular type in a series of processors at a time?
What I would want is for only one type of item to exist in the chain of processors at a time. And if an incoming item is of a different type, it should be blocked until the processors are cleared of the dissimilar type.
Also, I would like to make sure that after a batch of items (2 let's say), the system re-evaluates the longest waiting item to send into the processor chain.(Otherwise, there wouldn't be any opportunity for an incoming item of a different type to enter if the processors never end up getting completely cleared). So after a batch of 2 items of type 1 enters the first processor, another item of type 1 will be blocked even though there's room on the processors if an item of type 2 has been waiting longer which will take priority.
What would be the easiest way to accomplish this?
Thanks in advance!