This was a hard one. I need to make sure that we send an END cell
when the stream is dropped. But we can't call an .await from inside
the drop() function, since drop() isn't async, and we don't have an
executor.
Fortunately, you can call send() on a oneshot::Sender without having
to await on it, so that's the obvious thing to put in drop(). But
we need some way to make sure that the oneshot::Receiver is given to
the reactor, and is .awaited. For that, we needed a control
channel. And the reactor needs to treat the control channel and the
close messages as equally important.
So that's how I wound up with a
Fuse<Select<mpsc::Receiver<Result<Foo>>,
SelectAll<Once<oneshot::Receiver<Foo>>>>>.
I doubt that this is actually the best way to handle any of this!
By putting the cell-sink in a box, we can get rid of the need for
having everything that uses a channel or a circuit know what kind
of underlying TLS implementation it has.
This is not a production-ready implementation: it will break if a
circuit is used for anything while an extend is pending.
Client-demo can now build 3-hop circuits.
Arti is a rust tor implementation. It's project I've been working
on for a few months now, in weekends and in spare time. It doesn't
speak the tor protocol yet, and it doesn't connect to the network at
all.
It needs much more documentation and testing, but I'm just about
ready to show it to others. See the README.md for a description of
what is there and what isn't.