05nelsonm / kmp-tor

Kotlin Multiplatform Library for embedding Tor into your applications
Apache License 2.0
33 stars 5 forks source link

Add ability to interrupt Start/Restart #381

Closed 05nelsonm closed 3 months ago

05nelsonm commented 3 months ago

Start and Restart can take a while... If StopDaemon is enqueued, it should interrupt that startup if still active.

05nelsonm commented 3 months ago

This is pretty complex and requires ActionProcessor.doStart to launch its own cancelable coroutine so that, if Stop is called, it can be cancelled. A lot of other implications there regarding completion of other batched jobs and how to handle them on completion, but will need to refactor several things in order to achieve this w/o increasing complexity.