tor-proto: Add Notify{Sender,Receiver}
channel
An async notification channel. I plan to use this for stream flow control (so that the reactor can notify the DataReader
when it has sent an XOFF message), but it's self-contained so I've broken it out into a separate MR.
Alternatively we could have used async-notify
, but it's not super popular and I don't see a need to bring in another dependency when we could do the same without much code. I also prefer the sender/receiver API for flow control compared to async-notify
and tokio, to make it clear who is notifying who.
This uses postage::watch::{Sender,Receiver}
internally.