Skip to content

adding callback on shutdown - #82

Merged
stevegury merged 1 commit into
rsocket:masterfrom
robertroeser:master
May 5, 2016
Merged

adding callback on shutdown#82
stevegury merged 1 commit into
rsocket:masterfrom
robertroeser:master

Conversation

@robertroeser

Copy link
Copy Markdown
Member

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

* Invoked when ReactiveSocket is closed
*
* @throws IllegalStateException if this method is called more than once per instance
*/

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

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

@NiteshKant

Copy link
Copy Markdown
Contributor

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

@robertroeser

Copy link
Copy Markdown
Member Author

@NiteshKant ok switched it back to a Completable

@NiteshKant

Copy link
Copy Markdown
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