OnEvent

fun interface OnEvent<in Data> : ItBlock<Data> (source)

A callback for dispatching event data.

Implementations of OnEvent should not throw exception, be fast, and non-blocking.

NOTE: If OnEvent is being utilized with TorRuntime APIs, exceptions will be treated as an UncaughtException and dispatched to RuntimeEvent.ERROR.

See also

Types

Link copied to clipboard
object Companion
Link copied to clipboard
fun interface Executor

kmp-tor utilizes several different background threads for Jvm & Native which events are generated on, then dispatches them to subscribed observers' OnEvent callbacks. The Executor API allows for fine-tuning the context in which that dispatching occurs on several customizable levels.

Functions

Link copied to clipboard
abstract operator fun invoke(it: Data)