dwrtc / ch.hsr.dsl.dwrtc.signaling / GetCustomFuture

GetCustomFuture

open class GetCustomFuture<T, U> : GetFuture<T>

Get one element and transform it.

Constructors

<init>

GetCustomFuture(futureGet: FutureGet, transformer: (U) -> T)

Get one element and transform it.

Properties

futureGet

val futureGet: FutureGet

base TomP2P FutureGet

transformer

val transformer: (U) -> T

callable, to transform the DHT's response type to the method's return type. Note: when the response is null, the transformer is skipped.

Functions

onGet

open fun onGet(emitter: (data: T) -> Unit): Unit

A single element has been found and has been transformed

Inherited Functions

onNotFound

open fun onNotFound(emitter: () -> Unit): Unit

A single element has not been found