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

adding callback on shutdown #82

Merged
merged 1 commit into from
May 5, 2016
Merged

adding callback on shutdown #82

merged 1 commit into from
May 5, 2016

Conversation

robertroeser
Copy link
Member

As a callback that is called when a reactive socket is closed.

*
* @throws IllegalStateException if this method is called more than once per instance
*/
void onShutdown(Completable c);
Copy link
Member

Choose a reason for hiding this comment

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

Instead of returning void, I would return the previous Completable (and allow changing the callback).

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, why to ask for a Completable? This is like a close future for the socket, which is a single instance that anyone can subscriber/listen to. So, why not have something like:

Completable shutdownListener();

Copy link
Member

Choose a reason for hiding this comment

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

I think it's a good idea.

@robertroeser
Copy link
Member Author

@stevegury @NiteshKant changed it so that it returns a Publisher that is completed when the ReactiveSocket is closed

@NiteshKant
Copy link
Contributor

@robertroeser doesn't it make sense to have a Completable instead of Publisher<Void> as you had before?

@robertroeser
Copy link
Member Author

@NiteshKant ok switched it back to a Completable

@NiteshKant
Copy link
Contributor

ok revelation for me Completable here isn't RxJava Completable 😭

@stevegury stevegury merged commit 05ee843 into rsocket:master May 5, 2016
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