Loading
Commits on Source 8
-
henry authored
TB 44796: Convert `TorProviders` types to strings. This allows them to be used in log messages.
-
henry authored
TB 44796: Add `TorProviderState`, which tracks the state of a provider. We create a new `TorProviderBase` class which tracks this state, and the existing `TorProvider` now extends. `TorProviderBuilder.sys.mjs`: + We provide a callback to let the current provider instance let `TorProviderBuilder` know when this state has changed. + This will emit `TorProviderSateChanged` as a replacement for `TorProcessExited`. The `Stopped` state has the same role as the previous event, except it is more generic. This event also lets any consumers know when a provider has been just replaced (`Starting`) and successfully initialised (`Running`). `TorControlPort.sys.mjs`: + Add `onClosed` callback to signal to the `TorProvider` that the control port has closed, which will trigger `_stoppedInternal`. + Delay adding the event handler so the `TorProvider` only listens to a control port after it is successfully set up and adopted by the `TorProvider`. `TorProvider.sys.mjs`: + `TorProvider` no longer emits `TorProviderTopics.ProcessExited`. + Instead, `TorProvider` calls `_stoppedInternal` whenever the provider stops running. I.e. whenever the control port is closed, which includes when the process exits but also other scenarios where the control port might close unexpectedly.
-
henry authored
TB 44796: Convert the "none" provider into a `TorProviderNone` class, so it can be handled by the same logic as `TorProvider`.
-
henry authored
TB 44796: Add the `settledState` method to allow `TorConnect` to wait for the first provider's state after it has settled. This is a way to get the current providers state prior to having listened to `TorProviderStateChange`. Add the `replace` method to allow `TorConnect` to request a new provider on the user's behalf.
-
henry authored
TB 44796: Listen for ProviderStateChanged rather than ProcessStopped.
-
henry authored
TB 44796: Drop `TorProvider.isRunning`.
-
henry authored
TB 44796: Use `TorProvider.state` instead of `isRunning`.