You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The examples mention that unsubscribing from certain streams is necessary in order to stop other streams from "starving". It would be helpful if the documentation could explain what the conditions that lead to starvation are, as there doesn't appear to be any other mention of it.
The text was updated successfully, but these errors were encountered:
let (send, recv) = multiqueue::broadcast_queue(4);
for i in 0..2 { // or n
let cur_recv = recv.add_stream();
thread::spawn(move || {
for val in cur_recv {
println!("Stream {} got {}", i, val);
}
});
}
The recv itself is a stream - a reader with cursor into the queue (each cur_recv in the loop is also an another stream), so if recv not moving its cursor (by reading/iterating), the queue will not accept more message if it is already at its limit, thus, prevent producer from producing.
And @schets addressed this API problem in this: #15
The issue is caused since multiqueue currently stalls the producer when a consumer is behind. I'm looking into an api that allows consumers to remain unmonitored by the producer and error when they are overwritten. I'll update the docs with a good example when I have some time
The examples mention that unsubscribing from certain streams is necessary in order to stop other streams from "starving". It would be helpful if the documentation could explain what the conditions that lead to starvation are, as there doesn't appear to be any other mention of it.
The text was updated successfully, but these errors were encountered: