OnionService API questions
I think we will need to rethink the OnionService
API a bit:
- we will need some way of stopping a running service (and presumably also the tasks spawned by
launch
). Even if we implementedstop()
, restarting the stopped service wouldn't be possible, becauselaunch()
consumesunlaunched
- the
onion_name()
function (that implements thearti hss onion-name
command) needs to be moved toOnionService
. Currently, to construct anOnionService
, you need to provide some objects that aren't needed when buildingOnionService
in the "unbootrapped", unlaunchable "CLI mode" (e.g. aRuntime
, aStateMgr
) -
@Diziet notes that one possibility would be to rewrite
OnionService
using the typestate pattern
Edited by gabi-250