Factory

expect class Factory constructor(staticTag: String? = null, observers: Set<TorEvent.Observer> = emptySet(), interceptors: Set<TorCmdInterceptor<*>> = emptySet(), defaultExecutor: OnEvent.Executor = OnEvent.Executor.Immediate, debug: TorCtrl.Debugger?, handler: UncaughtException.Handler)(source)

A factory class for connecting to tor via its control listener.

See Factory.connect(https://kmp-tor.matthewnelson.io/library/runtime-ctrl/io.matthewnelson.kmp.tor.runtime.ctrl/-tor-ctrl/-factory/connect.html * @see connectAsync * @param staticTag Special string that will exclude TorEvent.Observer * with the same tag from removal until destroyed * @param observers Some initial observers to start with, static or not. * @param interceptors Intercepts to hook into executing jobs & modify * the TorCmd (if needed).

Parameters

defaultExecutor

The default OnEvent.Executor to fall back to when calling TorEvent.Observer.notify if it does not have its own.

debug

A callback for debugging info. MUST be thread safe. Any non-UncaughtException it throws will be swallowed.

handler

The UncaughtException.Handler to pipe bad behavior to. It MUST be thread-safe for Jvm & Native implementations.

actual class Factory constructor(staticTag: String?, observers: Set<TorEvent.Observer>, interceptors: Set<TorCmdInterceptor<*>>, defaultExecutor: OnEvent.Executor, debug: TorCtrl.Debugger?, handler: UncaughtException.Handler)(source)

A factory class for connecting to tor via its control listener.

Parameters

defaultExecutor

The default OnEvent.Executor to fall back to when calling TorEvent.Observer.notify if it does not have its own.

debug

A callback for debugging info. MUST be thread safe. Any non-UncaughtException it throws will be swallowed.

handler

The UncaughtException.Handler to pipe bad behavior to.

staticTag

Special string that will exclude TorEvent.Observer with the same tag from removal until destroyed.

observers

Some initial observers to start with, static or not.

interceptors

Intercepts to hook into executing jobs & modify the TorCmd (if needed).

See also

actual class Factory @JvmOverloads constructor(staticTag: String?, observers: Set<TorEvent.Observer>, interceptors: Set<TorCmdInterceptor<*>>, defaultExecutor: OnEvent.Executor, debug: TorCtrl.Debugger?, handler: UncaughtException.Handler)(source)

A factory class for connecting to tor via its control listener.

Parameters

defaultExecutor

The default OnEvent.Executor to fall back to when calling TorEvent.Observer.notify if it does not have its own.

debug

A callback for debugging info. MUST be thread safe. Any non-UncaughtException it throws will be swallowed.

handler

The UncaughtException.Handler to pipe bad behavior to. It MUST be thread-safe.

staticTag

Special string that will exclude TorEvent.Observer with the same tag from removal until destroyed

observers

Some initial observers to start with, static or not.

interceptors

Intercepts to hook into executing jobs & modify the TorCmd (if needed).

See also

Constructors

Link copied to clipboard
expect constructor(staticTag: String? = null, observers: Set<TorEvent.Observer> = emptySet(), interceptors: Set<TorCmdInterceptor<*>> = emptySet(), defaultExecutor: OnEvent.Executor = OnEvent.Executor.Immediate, debugger: ItBlock<String>? = null, handler: UncaughtException.Handler)
expect constructor(staticTag: String? = null, observers: Set<TorEvent.Observer> = emptySet(), interceptors: Set<TorCmdInterceptor<*>> = emptySet(), defaultExecutor: OnEvent.Executor = OnEvent.Executor.Immediate, debug: TorCtrl.Debugger?, handler: UncaughtException.Handler)
actual constructor(staticTag: String?, observers: Set<TorEvent.Observer>, interceptors: Set<TorCmdInterceptor<*>>, defaultExecutor: OnEvent.Executor, debugger: ItBlock<String>?, handler: UncaughtException.Handler)
actual constructor(staticTag: String?, observers: Set<TorEvent.Observer>, interceptors: Set<TorCmdInterceptor<*>>, defaultExecutor: OnEvent.Executor, debug: TorCtrl.Debugger?, handler: UncaughtException.Handler)
@JvmOverloads
actual constructor(staticTag: String?, observers: Set<TorEvent.Observer>, interceptors: Set<TorCmdInterceptor<*>>, defaultExecutor: OnEvent.Executor, debugger: ItBlock<String>?, handler: UncaughtException.Handler)
@JvmOverloads
actual constructor(staticTag: String?, observers: Set<TorEvent.Observer>, interceptors: Set<TorCmdInterceptor<*>>, defaultExecutor: OnEvent.Executor, debug: TorCtrl.Debugger?, handler: UncaughtException.Handler)

Functions

Link copied to clipboard
fun connect(path: File): TorCtrl

Connects to a tor control listener via UnixDomainSocket.

Connects to a tor control listener via TCP port.

Link copied to clipboard
expect suspend fun connectAsync(path: File): TorCtrl

Connects to a tor control listener via UnixDomainSocket.

expect suspend fun connectAsync(address: IPSocketAddress): TorCtrl

Connects to a tor control listener via TCP socket.

actual suspend fun connectAsync(path: File): TorCtrl

Connects to a tor control listener via UnixDomainSocket.

actual suspend fun connectAsync(address: IPSocketAddress): TorCtrl

Connects to a tor control listener via TCP socket.

actual suspend fun connectAsync(path: File): TorCtrl

Connects to a tor control listener via UnixDomainSocket.

actual suspend fun connectAsync(address: IPSocketAddress): TorCtrl

Connects to a tor control listener via TCP socket.