Commit af5a8c2
authored
refactor(iroh): Add send queue between relay actor and relays (#3026)
## Description
This introduces a new packet send queue between the RelayActor and the
various ConnectedRelayActors. Each ConnectedRelayActor will not block
while sending them to the actual relay client.
This is important for the relay client to become nothing more than a
stream and sink directly connected to the network stream in future
refactoring.
It does not yet change the communication between
AsyncUdpSocket::try_send and the RelayActor itself to keep this change
smaller. This also should become a separate channel so that the inbox
can still handle messages when the relay channel is full.
This is a small incremental change that does a few not very nice things,
like having some .expect() calls. This is deliberate to keep the changes
smaller to review and reason about.
## Breaking Changes
<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->
## Notes & open questions
Pay most attention to the ConnectedRelayActor and the way it does create
a send future without blocking. The exact mechanism will change once it
is sending to a stream, but in the mean time this needs to be somewhat
reasonable.
There are still tons of bugs in here. But I don't think there are any
regressions. All the bugs existed already.
## Change checklist
- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.1 parent 08671bb commit af5a8c2
2 files changed
+200
-83
lines changed
0 commit comments