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

Add async sink for sending packets #373

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jethrogb
Copy link

Add an implementation of futures::Sink to be able to send packets asynchronously. (UNIX only - I'm not too familiar with Windows).

The Sink API is a bit difficult to understand. This implementation is modeled after Unfold and IntoSink.

let mut guard = ready!(sink.inner.poll_write_ready_mut(cx))?;

if let Some(packet) = packet_storage.take() {
match guard.try_io(

Choose a reason for hiding this comment

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

Nitpick: this match is a bit hard to parse due to the closure. Consider create a separate variable for it.

@Wojtek242
Copy link
Collaborator

@jethrogb Thanks for the PR!

Could you please do the following so that I can merge this PR:

  1. Add a CHANGELOG entry,
  2. Fix clippy lints
  3. Add unit tests

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