summaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src/event.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-dirmgr: update status reporting to consider skew toleranceNick Mathewson2022-05-111-23/+66
| | | | | | In our status reporting code, we consider an expired-but-still-usable directory still bootstrapped, but not 100% bootstrapped.
* Merge branch 'disallowed_lint' into 'main'eta2022-03-301-1/+0
|\ | | | | | | | | Remove allow(clippy::disallowed_methods) lint flag. See merge request tpo/core/arti!437
| * Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-301-1/+0
| |
* | Make daemon tasks self-contained; introduce NetDirProvidereta2022-03-301-20/+3
|/ | | | | | | | | | | | | | | The various background daemon tasks that `arti-client` used to spawn are now handled inside their respective crates instead, with functions provided to spawn them that return `TaskHandle`s. This required introducing a new trait, `NetDirProvider`, which steals some functionality from the `DirProvider` trait to enable `tor-circmgr` to depend on it (`tor-circmgr` is a dependency of `tor-dirmgr`, so it can't depend on `DirProvider` directly). While we're at it, we also make some of the tasks wait for events from the `NetDirProvider` instead of sleeping, slightly increasing efficiency.
* Merge branch 'no-system-time' into 'main'eta2022-03-301-0/+1
|\ | | | | | | | | | | | | Don't use SystemTime::now() Closes #306 See merge request tpo/core/arti!365
| * use wallclock where possible in teststrinity-1686a2022-02-261-0/+1
| |
* | Move skip_fmt into tor-basic-utilsIan Jackson2022-03-041-1/+1
| | | | | | | | | | | | | | Code motion and the minimal mechanical changes. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/375#note_2783078
* | Replace manual Default impl with educe+std in tor-dirmgrIan Jackson2022-03-021-8/+4
| |
* | Replace manual Debug impl with educe in tor-dirmgrIan Jackson2022-03-021-8/+5
|/
* tor-dirmgr: Create a bootstrap-status exporting mechanism.Nick Mathewson2022-01-181-4/+465
| | | | | | | | | | | | | | | | | | | | | | The interface is similar to the one exposed by `arti-client`: it internally uses postage::watch to give a series of events showing when a bootstrap status is changing. Thanks to the existing state/driver separation in the DirMgr design we don't need much new logic: each download state needs to expose (internally) how far along it is in its download, which the bootstrap code passes to the DirMgr if it has changed. I believe that in the long run, we'll probably want to expose more (or different) information here, and we'll want to process it differently. With that in mind, I've made the API for `DirBootstrapStatus` deliberately narrow, so that we can change its of its internal later on without breaking code that depends on it. (The information exposed by this commit is not yet summarized in `arti-client`.) Part of #96.
* Refactor directory events to use a FlagPublisher mechanism.Nick Mathewson2021-12-141-86/+327
| | | | | | | | This approach tries to preserve the current interface, but uses a counter-based event backend to implement a coalescing stream of events that can be represented as small integers. The advantage here is that publishing events no longer needs to be a blocking operation, since there is no queue to fill up.
* add semicolons if nothing returnedDaniel Eades2021-11-251-1/+1
|
* Notify guard manager on network change and state flush.Nick Mathewson2021-10-101-0/+3
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+118
This will cause some pain for now, but now is really the best time to do this kind of thing.