-
Notifications
You must be signed in to change notification settings - Fork 183
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
Conversation
6ca8867
to
c38b6c4
Compare
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); |
There was a problem hiding this comment.
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.
c38b6c4
to
897b45f
Compare
servicetalk-concurrent-api/src/main/java/io/servicetalk/concurrent/api/Publisher.java
Outdated
Show resolved
Hide resolved
servicetalk-concurrent-api/src/main/java/io/servicetalk/concurrent/api/Publisher.java
Outdated
Show resolved
Hide resolved
...-concurrent-api/src/main/java/io/servicetalk/concurrent/api/PublisherFlatMapConcatUtils.java
Outdated
Show resolved
Hide resolved
...-concurrent-api/src/main/java/io/servicetalk/concurrent/api/PublisherFlatMapConcatUtils.java
Outdated
Show resolved
Hide resolved
...lk-concurrent-internal/src/main/java/io/servicetalk/concurrent/internal/ConcurrentUtils.java
Outdated
Show resolved
Hide resolved
servicetalk-concurrent-api/src/main/java/io/servicetalk/concurrent/api/Publisher.java
Show resolved
Hide resolved
...urrent-api/src/test/java/io/servicetalk/concurrent/api/PublisherFlatMapConcatSingleTest.java
Outdated
Show resolved
Hide resolved
...urrent-api/src/test/java/io/servicetalk/concurrent/api/PublisherFlatMapConcatSingleTest.java
Outdated
Show resolved
Hide resolved
...lk-concurrent-internal/src/main/java/io/servicetalk/concurrent/internal/ConcurrentUtils.java
Outdated
Show resolved
Hide resolved
...urrent-api/src/test/java/io/servicetalk/concurrent/api/PublisherFlatMapConcatSingleTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after comments :)
Motivation:
Publisher.flatMapConcatSingle provides similar semantics to
Publisher.flatMapMergeSingle except the results are returned
in the same order as the original Publisher.