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.flatMapConcatSingle #2151

Merged
merged 3 commits into from
Mar 22, 2022

Conversation

Scottmitch
Copy link
Member

@Scottmitch Scottmitch commented Mar 17, 2022

Motivation:
Publisher.flatMapConcatSingle provides similar semantics to
Publisher.flatMapMergeSingle except the results are returned
in the same order as the original Publisher.

@Scottmitch
Copy link
Member Author

build failure attributed to #1716

static <T, R> Publisher<R> flatMapConcatSingle(final Publisher<T> publisher,
final Function<? super T, ? extends Single<? extends R>> mapper) {
return defer(() -> {
final Queue<Item<R>> results = newUnboundedSpscQueue(4);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note there is a queue here, and in flatMapMergeSingle. we can optimize and combine in the future with a native operator implementation but for now reusing flatMapMergeSingle is good enough to get started and keeps complexity down.

Motivation:
Publisher.flatMapConcatSingle provides similar semantics to
Publisher.flatMapMergeSingle except the results are returned
in the same order as the original Publisher.
@Scottmitch Scottmitch force-pushed the pub_flat_map_concat_single branch from c38b6c4 to 897b45f Compare March 19, 2022 09:13
@bondolo bondolo added enhancement New feature or request API PR with API changes (New or Deprecated) labels Mar 21, 2022
Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after comments :)

@Scottmitch Scottmitch merged commit cdc249e into apple:main Mar 22, 2022
@Scottmitch Scottmitch deleted the pub_flat_map_concat_single branch March 22, 2022 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API PR with API changes (New or Deprecated) enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants