Skip to content

tor-proto::circuit::StreamMap: Use StreamPollSet

Jim Newsome requested to merge jnewsome/arti:use-unordered-futures-rebased into main
  • Refactors StreamMap to use StreamPollSet to manage its receivers for mpsc streams.
  • Extends StreamMap to support iterating only over streams that have a pending outgoing message, and in round-robin order.
  • Updates circuit::reactor::Reactor to use this functionality. It now iterates only over streams that have a ready outgoing message, and only actually "pops" a message that is ready to be sent.

This mildly simplifies the circuit reactor, but more importantly clears the way to:

  • Remove the "outbound queue" of messages that were pulled from stream channels but that we couldn't send yet due to congestion control.
  • Support opportunistic packing when preparing to send a relay message. (proposal 340).
  • Refactor the circuit reactor's run_once into futures that we can select! over.

Progress on #1421 (closed), #1397 (closed), #1067

Edited by Jim Newsome

Merge request reports