dwrtc / ch.hsr.dsl.dwrtc.signaling / GetAllCustomFuture

GetAllCustomFuture

class GetAllCustomFuture<T, U> : GetFuture<T>

Get multiple elements and transform them

Constructors

<init>

GetAllCustomFuture(futureGet: FutureGet, transformer: (List<U>) -> T)

Get multiple elements and transform them

Properties

futureGet

val futureGet: FutureGet

base TomP2P FutureGet

transformer

val transformer: (List<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 (onNotFound will be called)

Functions

onGet

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

Multiple element have been found and have been transformed

onNotFound

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

Multiple elements have not been found