Skip to content

[3.0.0 prep] Async packet sink (sending) - #405

Open
cicku wants to merge 2 commits into
rust-pcap:mainfrom
cicku:async-packet-sink
Open

[3.0.0 prep] Async packet sink (sending)#405
cicku wants to merge 2 commits into
rust-pcap:mainfrom
cicku:async-packet-sink

Conversation

@cicku

@cicku cicku commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Supersedes #373.

@cicku
cicku force-pushed the async-packet-sink branch 2 times, most recently from 1c75fa5 to 1918e47 Compare August 24, 2026 19:42
@cicku
cicku force-pushed the async-packet-sink branch from 1918e47 to 1a3320b Compare August 31, 2026 21:19
@cicku
cicku force-pushed the async-packet-sink branch from 1a3320b to d7c65d2 Compare September 2, 2026 16:51
@cicku
cicku marked this pull request as ready for review September 4, 2026 05:03
@cicku
cicku marked this pull request as draft September 4, 2026 15:52
@cicku
cicku marked this pull request as ready for review September 4, 2026 15:57
@cicku

cicku commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

This PR is only for sending packets - However, if #344 is looking for a singular solution, we can either:

  1. implement Sink on PacketStream where T = Active.
  2. make a separate Capture::duplex() returning a PacketDuplex that is both traits.

@cicku cicku changed the title [3.0.0 prep] Async packet sink [3.0.0 prep] Async packet sink (sending) Sep 4, 2026

@Wojtek242 Wojtek242 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tiny comment about a "magic constant"

Comment thread src/sink/mod.rs
// Linux can be any executor, as it holds nothing of tokio's; 128 is what tokio allows
// a task between yields. Spending the task's budget as well holds a task that also
// does tokio I/O to one budget between yields rather than one for each source.
if self.sent_since_yield == 128 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Define 128 somewhere as a const with a self-explanatory name

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