dwrtc / ch.hsr.dsl.dwrtc.signaling / Future

Future

open class Future

Base class for all our Futures.

This mainly decouples our Futures from the TomP2P Futures. This means, users of this class need not import TomP2P.

Note: DO have a look at how TomP2P defines completion, success and failure before using this!

Constructors

<init>

Future(baseFuture: BaseFuture)

Base class for all our Futures.

Properties

baseFuture

val baseFuture: BaseFuture

base TomP2P BaseFuture

Functions

await

fun await(): Future

Await async operation to end

awaitListeners

fun awaitListeners(): Future

Await all registered listeners

onComplete

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

An operation has completed. Check net.tomp2p.futures.BaseFuture.onComplete for the full semantics

onFailure

fun onFailure(emitter: (failedReason: String) -> Unit): Unit

The connection has failed. Check net.tomp2p.futures.BaseFuture.onFailure for the full semantics

onSuccess

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

A response has been received. Check net.tomp2p.futures.BaseFuture.onSuccess for the full semantics

Inheritors

GetFuture

open class GetFuture<T> : Future

Base class for all futures that get something. Get one element.