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

Single.flatMapPublisher full implementation #6015

Closed
davidmoten opened this issue May 23, 2018 · 6 comments
Closed

Single.flatMapPublisher full implementation #6015

davidmoten opened this issue May 23, 2018 · 6 comments

Comments

@davidmoten
Copy link
Collaborator

I noticed Single.flatMapPublisher is implemented as toFlowable().flatMapPublisher(...) which subjects the one flowable to batched requests. I'd like to have requests go straight through to the one flowable. Can I contribute this operator?

The operator at the moment is at https://github.com/davidmoten/rxjava2-http/blob/master/src/main/java/org/davidmoten/rx2/io/internal/FlowableSingleFlatMapPublisher.java without fusion. I can add more tests, fusion (transitive as per doOnEach) and follow the projects's naming and visibility conventions.

@akarnokd
Copy link
Member

Sure.

@akarnokd
Copy link
Member

In case you haven't started yet, you may want to wait for #6017 so the changes can be benchmarked.

@davidmoten
Copy link
Collaborator Author

That's brilliant, thanks

@davidmoten
Copy link
Collaborator Author

A question about fusion. I notice that timeout(Long, TimeUnit) doesn't support fusion and I suspect the operator I'm writing is similar. The problem is that a subscription is handed to downstream while the Single emission is being calculated and the resultant mapped Flowable is unknown. Just after the subscription is handed to downstream (via onSubscribe) requestFusion is called but of course at that point the fusion characteristics of the mapped Flowable is unknown and QueueFuseable.NONE is returned.

Should I chase fusion for this operator? Any suggestions?

@akarnokd
Copy link
Member

Fusion won't work here due to the delayed subscription to the Flowable. Don't bother with it.

@davidmoten
Copy link
Collaborator Author

Righto, ta.

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

No branches or pull requests

2 participants