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

feat: implemented cancel frame handling #49

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

yuriykulikov
Copy link
Contributor

This closes Support CANCEL Frames for Request-Stream #48

Client will send a CANCEL frame for a dropped stream when the next payload is received for this stream and the server will inform the RSocket implementation that the stream is closed.

Motivation:

Closing the streams upon reception of a CANCEL frame allows to free up the resources (for example memory allocated for buffers).

Modifications:

For the client: in on_payload() check is_closed() and send CANCEL Frame if downstream is closed.
For the server: Streams returned by the RSocket implementation are wrapped in Aborable. When the CANCEL Frame is received, this Abortable is aborted.

Result:

CANCEL frames are send by the client and handled by the server.

Client will send a CANCEL frame for a dropped stream
when the next payload is received for this stream.
Cargo.toml Show resolved Hide resolved
rsocket/src/transport/socket.rs Show resolved Hide resolved
Copy link
Member

@jjeffcaii jjeffcaii left a comment

Choose a reason for hiding this comment

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

LGTM

@jjeffcaii jjeffcaii merged commit efad362 into rsocket:master Sep 1, 2021
@jjeffcaii
Copy link
Member

@yuriykulikov Thanks for your hard work! 👍

@yuriykulikov
Copy link
Contributor Author

@jjeffcaii thank you for a prompt review! I will be happy to make more contributions if I can.

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.

None yet

2 participants