Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DelaySubscription Operator #80

Open
Jackstone92 opened this issue Mar 7, 2021 · 1 comment
Open

Add DelaySubscription Operator #80

Jackstone92 opened this issue Mar 7, 2021 · 1 comment

Comments

@Jackstone92
Copy link

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 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.

@Jackstone92 Jackstone92 changed the title Add DelaySubscription Operator Add DelaySubscription Operator Mar 7, 2021
@mihai8804858
Copy link
Contributor

@Jackstone92 #117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants