summaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr/src/daemon.rs
Commit message (Collapse)AuthorAgeFilesLines
* Refactor tor-guardmgr's inter-task communication.Nick Mathewson2021-11-021-41/+7
| | | | | | | | | This is based on @eta's patches for !118 and !119: Since we already have an unbounded channel, we don't need to use an elaborate mess of one-shot senders. We can just use the unbounded_send() method, which also lets us enqueue a message without having to await. Closes #219.
* Improve some documentation linksNick Mathewson2021-10-291-3/+3
| | | | | | | | | Instead of putting a fully qualified name in the text, in most cases we should just use the short name of the type or function we're referring to. In other words, instead of saying [`crate::module::Foo`], we should typically say [`Foo`](crate::module::Foo).
* Rename GuardStatusMsg, make it public, add an `Indeterminate` case.Nick Mathewson2021-10-131-2/+2
|
* Use an mpsc::unbounded() channel in GuardMgr.Nick Mathewson2021-10-101-5/+4
| | | | | | | | | | | | The advantage here is that we no longer have to use a futures-aware Mutex, or a blocking send operation, and therefore can simplify a bunch of the GuardMgr APIs to no longer be async. That'll avoid having to propagate the asyncness up the stack. The disadvantage is that unbounded channels are just that: nothing in the channel prevents us from overfilling it. Fortunately, the process that consumes from the channel shouldn't block much, and the channel only gets filled when we're planning a circuit path.
* Tests for top-level GuardMgr.Nick Mathewson2021-10-071-11/+32
| | | | | | | Also, refactor our message handling to be more like the tor_proto reactors. The previous code had a bug where, once the stream of events was exhausted, we wouldn't actually get any more notifications.
* Initial backend implementation for guard node manager.Nick Mathewson2021-10-071-0/+102
There are some missing parts here (like persistence and tests) and some incorrect parts (I am 90% sure that the "exploratory circuit" flag is bogus). Also it is not integrated with the circuit manager code.