Skip to content
Snippets Groups Projects

channel: Provide and use Sink::prepare_send_from

Merged Ian Jackson requested to merge Diziet/arti:channel into main

From the principal commit message:

This is a general-purpose implementation of the ad-hoc approach
currently taken in (eg) crates/tor-proto/src/channel/reactor.rs,
with an API intended to defned against the more obvious mistakes.

This allows us to separate the two concerns: the channel reactor can
focus on handling channel cells and control messages and is over 2.5x
shorter.

The complexity of the manual sink implementation, and the machinery
needed to avoid having to suspend while holding an item, are dealt
with separately.  That separate implemenation now has proper
documentation. [...]

We use `extend` to define this as an extension trait.  A competitor is
`ext` but in my personal projects I have found `extend` slightly
better.

I'm not sure if this is OK in tor-basic-utils. I think right now we don't have our own futures utils, other than tor-rtcompat which seems a much worse place.

Edited by Ian Jackson

Merge request reports

Approval is optional

Merged by Ian JacksonIan Jackson 2 years ago (May 23, 2022 11:39am UTC)

Merge details

  • Changes merged into main with 60551711.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading