OnSuccess

fun interface OnSuccess<in T> : ItBlock<T> (source)

An alias of ItBlock indicating a callback for something occurring successfully.

NOTE: Exceptions should not be thrown within the OnSuccess lambda. If OnSuccess is being utilized with TorRuntime APIs, it will be treated as an UncaughtException and dispatched to RuntimeEvent.ERROR observers.

See also

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract operator fun invoke(it: T)
Link copied to clipboard
@JvmStatic
@JvmName(name = "immediateSuccessJob")
fun <T> OnSuccess<T>.toImmediateSuccessJob(name: String, response: T, handler: UncaughtException.Handler): EnqueuedJob

Creates a EnqueuedJob which immediately invokes OnSuccess with the provided response.