dwrtc / ch.hsr.dsl.dwrtc.util / net.tomp2p.dht.FutureGet / onGetCustom

onGetCustom

fun <T, U> FutureGet.onGetCustom(emitter: (data: U?, future: BaseFuture) -> Unit, transformer: (T) -> U): Unit

A response has been received (for one element) and you need to transform it, before returning.

Parameters

emitter - callable, when the response has been received and transformed

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