Post

Replies

Boosts

Views

Activity

PassthroughSubject with multiple subscribers doesn't respect their individual demands
The behavior of a PassthroughSubject with multiple downstream subscribers doesn't seem to obey Combine's principle of allowing the subscriber to control the flow of data by only receiving the amount of data it requests using Subscriber.receive(_ input: Self.Input) -> Subscribers.Demand. PassthroughSubject seems to deliver output to its downstream subscribers based on some idea of "aggregate" demand. That is, if one of its subscribers wants Demand.unlimited output and another wants Demand.none, PassthroughSubject will choose to deliver an unlimited amount of values to both subscribers, instead of delivering an unlimited amount to the first and none to the second. Is this a bug or expected behavior?
4
0
3.5k
Jun ’20