You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, TorManager.start starts the tor daemon and then returns success or failure (before Tor bootstraps); it only starts the tor daemon, nothing more. After tor bootstraps, AddressInfo is then dispatched as an event to its attached listeners.
This is a bit of a UX pain point for library consumers, as they need to add listeners and put all that logic there for instantiating and tearing down Http clients.
Tor has 2 phases to it's startup process:
Starting the tor daemon
Bootstrapping
Bootstrapping phase is unpredictable as it is dependent on many outside factors (internet being down, tor network consensus being slow, not finding enough network peers, etc.). As such, TorManager.start simply *cannot await for bootstrapping to complete as it would inhibit other calls in the queue from being executed (such as stop or restart) which should interrupt the bootstrap phase.
As I do not want to increase the current API surface area, I figure something in the samples will suffice for the time being.
Extension function should:
Check TorManager's current state and currently set AddressInfo and, if available, return it as the result
If not, it should register a listener before calling start and suspend until the registered listener catches the AddressInfo or tor is shutdown.
The text was updated successfully, but these errors were encountered:
Currently,
TorManager.start
starts the tor daemon and then returns success or failure (before Tor bootstraps); it only starts the tor daemon, nothing more. After tor bootstraps,AddressInfo
is then dispatched as an event to its attached listeners.This is a bit of a UX pain point for library consumers, as they need to add listeners and put all that logic there for instantiating and tearing down Http clients.
Tor has 2 phases to it's startup process:
Bootstrapping phase is unpredictable as it is dependent on many outside factors (internet being down, tor network consensus being slow, not finding enough network peers, etc.). As such,
TorManager.start
simply *cannot await for bootstrapping to complete as it would inhibit other calls in the queue from being executed (such asstop
orrestart
) which should interrupt the bootstrap phase.As I do not want to increase the current API surface area, I figure something in the samples will suffice for the time being.
Extension function should:
TorManager
's current state and currently setAddressInfo
and, if available, return it as the resultstart
and suspend until the registered listener catches theAddressInfo
or tor is shutdown.The text was updated successfully, but these errors were encountered: