Skip to content

Simplify RSocketClient/Server implementation and avoid unnecessary flatMap#467

Merged
robertroeser merged 1 commit into
rsocket:1.0.xfrom
rdegnan:1.0.x
Feb 5, 2018
Merged

Simplify RSocketClient/Server implementation and avoid unnecessary flatMap#467
robertroeser merged 1 commit into
rsocket:1.0.xfrom
rdegnan:1.0.x

Conversation

@rdegnan

@rdegnan rdegnan commented Feb 3, 2018

Copy link
Copy Markdown
Member

Most of the diff here is from running googleJavaFormat -- the real changes are in RSocketClient/Server.

@rdegnan rdegnan requested a review from robertroeser February 3, 2018 22:09
.subscribe();
.subscribe(null, this::handleSendProcessorError);

this.receiveDisposable = connection.receive().subscribe(this::handleFrame, errorConsumer);

@robertroeser robertroeser Feb 4, 2018

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.

This no longer composes the backpressure from the client code and netty. That's why it's a flat map - now it's disconnected because you have another subscription.

connection.onClose().doFinally(signalType -> cleanup()).subscribe(null, errorConsumer);

connection
.send(sendProcessor)

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 wrote them this way for readability - operator fusion should be happening so the difference should be negligible.

@robertroeser robertroeser merged commit ec42c83 into rsocket:1.0.x Feb 5, 2018
@bsideup bsideup mentioned this pull request Jan 3, 2019
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.

2 participants