Facility to disable even more background tasks when dormant.
With !429 (merged), @eta implemented a facility to disable periodic events when we're dormant. That's cool: but in order to implement a full dormant mode, we need this to extend to non-periodic events, such as directory downloads, guardmgr updates, and more.
(Generally, any time that we spawn a task with an open-ended timeframe, we should make that task return a handle that can be used to enable/disable it.)
This fits tangentially with work I've been doing on tor-guardmgr
and tor-dirmgr
, so I'll take it on.
This is necessary for #90.