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 Publisher.scanWithLifetime(ScanWithLifetimeMapper) operator #1450

Merged
merged 6 commits into from
Apr 7, 2021

Conversation

tkountis
Copy link
Contributor

@tkountis tkountis commented Mar 20, 2021

Motivation:
The existing Publisher.scanWith(...) operator is not exposing cancellations to the end user. Use cases that need to control resource lifetimes (ie. clean-up), can't do so on cancel.

Modifications:
Add a new Publisher operator, scanWithLifetime(ScanWithLifetimeMapper), that also captures cancellation and invokes an afterFinally callback on all terminal signal (complete, error & cancel).

Result:
A new lifetime aware scanWith operator.

@tkountis tkountis self-assigned this Mar 20, 2021
@tkountis tkountis force-pushed the feature/scanWithLifetime branch from 4ea727d to 42ee6a4 Compare March 29, 2021 23:56
@tkountis tkountis force-pushed the feature/scanWithLifetime branch from 42ee6a4 to 28df65b Compare March 30, 2021 00:01
@tkountis tkountis requested a review from Scottmitch March 30, 2021 00:05
@tkountis tkountis force-pushed the feature/scanWithLifetime branch from 8d98195 to 83488fb Compare April 1, 2021 20:58
@tkountis tkountis requested a review from Scottmitch April 7, 2021 15:08
@tkountis tkountis merged commit 6df4265 into apple:main Apr 7, 2021
@tkountis tkountis deleted the feature/scanWithLifetime branch April 7, 2021 15:44
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

Successfully merging this pull request may close these issues.

3 participants