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
It would be great if a Combine implementation of the DelaySubscription operator could be added to this repo in order to further reduce the number of missing operators when compared with other reactive libraries (eg. RxSwift as per the cheat sheet).
As we'd expect from existing implementations found in other libraries, this DelaySubscription operator would allow a subscription to be time-shifted. This means that rather than shifting all emissions of a publisher forward in time (as per the current Delay implementation), only the subscription would be delayed.
Using a real-world example of a live video streaming app to explain the desired difference, if the streaming source was emitting frames (a "hot" publisher), then using .delay(for: .seconds(3), scheduler: scheduler) would mean that when sinked on, frames would be received 3 seconds behind the actual emission. By using .delaySubscription(for: .seconds(3), scheduler: scheduler) this would mean that after the initial 3 second delay (where frames would be dropped), frames would then be received in real time.
The text was updated successfully, but these errors were encountered:
Jackstone92
changed the title
Add DelaySubscription Operator
Add DelaySubscription Operator
Mar 7, 2021
Hi everyone,
It would be great if a Combine implementation of the
DelaySubscription
operator could be added to this repo in order to further reduce the number of missing operators when compared with other reactive libraries (eg. RxSwift as per the cheat sheet).As we'd expect from existing implementations found in other libraries, this
DelaySubscription
operator would allow a subscription to be time-shifted. This means that rather than shifting all emissions of a publisher forward in time (as per the currentDelay
implementation), only the subscription would be delayed.Using a real-world example of a live video streaming app to explain the desired difference, if the streaming source was emitting frames (a "hot" publisher), then using
.delay(for: .seconds(3), scheduler: scheduler)
would mean that when sinked on, frames would be received 3 seconds behind the actual emission. By using.delaySubscription(for: .seconds(3), scheduler: scheduler)
this would mean that after the initial 3 second delay (where frames would be dropped), frames would then be received in real time.The text was updated successfully, but these errors were encountered: