withApi

open fun <T> withApi(binder: ResourceLoader.RuntimeBinder, block: TorApi.() -> T): T(source)

Lambda for running tor via TorApi.

e.g.

loaderNoExec.withApi(myBinder) {
    torRunMain(myTorArgs)
    assertEquals(TorApi.State.STARTED, state())
}

See also

Throws

IllegalStateException

if binder is inappropriate, there was a failure to extract libtor from application resources, or libtor failed to load.

if there was a failure to extract libtor from application resources.