open class GetFuture<T> : Future
Base class for all futures that get something. Get one element.
In the subclasses, you will get easy semantics.
onGet
is called when a successful response has been received (not null)onNotFound
is called, when a response has been received, but the answer is null, indicating that the searched key was not foundThe subclasses differ by these orthogonal concepts:
All
Custom
UserId
from the DHT, but you want to return a User
GetFuture(futureGet: FutureGet)
Base class for all futures that get something. Get one element. |
val futureGet: FutureGet
base TomP2P FutureGet |
val baseFuture: BaseFuture
base TomP2P BaseFuture |
open fun onGet(emitter: (data: T) -> Unit): Unit
A single element has been found |
|
open fun onNotFound(emitter: () -> Unit): Unit
A single element has not been found |
fun await(): Future
Await async operation to end |
|
fun awaitListeners(): Future
Await all registered listeners |
|
fun onComplete(emitter: () -> Unit): Unit
An operation has completed. Check net.tomp2p.futures.BaseFuture.onComplete for the full semantics |
|
fun onFailure(emitter: (failedReason: String) -> Unit): Unit
The connection has failed. Check net.tomp2p.futures.BaseFuture.onFailure for the full semantics |
|
fun onSuccess(emitter: () -> Unit): Unit
A response has been received. Check net.tomp2p.futures.BaseFuture.onSuccess for the full semantics |
class GetAllCustomFuture<T, U> : GetFuture<T>
Get multiple elements and transform them |
|
open class GetCustomFuture<T, U> : GetFuture<T>
Get one element and transform it. |