FutureDataType
- the data type of the contents inside the result futurepublic abstract static class RemoteMethod.FuturePreparator<FutureDataType> extends Object
Future
instance
containing the desired result of the client from the reply Event
instance.Constructor and Description |
---|
RemoteMethod.FuturePreparator(rsb.patterns.Future<FutureDataType> future)
Creates a new instance with a
Future instance that is
eventually passed to the client. |
Modifier and Type | Method and Description |
---|---|
void |
error(Throwable error)
Method called in case of an error.
|
rsb.patterns.Future<FutureDataType> |
getFuture()
Returns the future where the result should be prepared for.
|
abstract void |
result(Event resultEvent)
This method needs to be implemented with the conversion logic from
the
Event instance with the result to the final
Future interface. |
public RemoteMethod.FuturePreparator(rsb.patterns.Future<FutureDataType> future)
Future
instance that is
eventually passed to the client. Internally a WeakReference
will be used to track this future. This allows the client to ignore
the result future in a way that we sometimes can notice this and
avoid additional work.future
- the future to contain the final result.public rsb.patterns.Future<FutureDataType> getFuture()
Future
instance or null
if the client
does not hold a reference on this future anymore. In such a
case nothing needs to be done.public abstract void result(Event resultEvent)
Event
instance with the result to the final
Future
interface.resultEvent
- result event from the server callCopyright © 2018 CoR-Lab. All rights reserved.