question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Completable missing lambda-subscibe() w/ onSubscribe parameter to provide Disposable

See original GitHub issue

Completable does not have a lambda subscribe() method that provides a Disposable via an onSubscribe parameter, equivalent to the one implemented in Observable:

public final Disposable subscribe(
                    Consumer<? super T> onNext,
                    Consumer<? super Throwable> onError,
                    Action onComplete,
                    Consumer<? super Disposable> onSubscribe)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
akarnokdcommented, Sep 26, 2017

I guess we can start creating issues marked with Design and 3.x so we don’t forget these.

1reaction
HolySamosacommented, Sep 27, 2017

@artem-zinnatullin Whoops, I guess I never hit the “Comment” button on my earlier reply.

Thanks for the suggestions, I can certainly work with them. And it looks like there is a plan to resolve the consistency issue in v3.

This is somewhat of a related tangent, but I wanted to get your thoughts before making a new issue. I think the documentation should make it clear that use of the .doOnSubscribe() should be avoided to acquire a Disposable for purposes of disposing / unsubscribing from the Rx chain. I had been doing this until I ran into an issue with dispose() not working as expected and after a fair amount of digging I discovered this SO answer by @akarnokd which schooled me in the error of my ways.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The result of subscribe is not used - Stack Overflow
The IDE does not know what potential effects your subscription can have when it's not disposed, so it treats it as potentially unsafe....
Read more >
Completable (RxJava Javadoc 3.1.5) - ReactiveX
Returns a Completable instance that calls the given onSubscribe callback with the disposable that the downstream CompletableObserver s receive upon ...
Read more >
RxJava 2: Where's disposable when subscribe observer?
In RxJava subscribe , which the user need to provided individual lambda for each type of return (e.g. onSuccess, onError and onComplete), ...
Read more >
Bug Patterns - Error Prone
The called constructor accepts a parameter with the same name and type as one of its caller's ... Duration.get() only works with SECONDS...
Read more >
Integromat - Error "Missing value of required parameter 'URL'."
Below is a screenshot of a scenario I have with added Error Handlers for each HTTP Get File module (I'm capturing images to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found