Hazelcast C++ Client
Public Member Functions | List of all members
hazelcast::client::ICompletableFuture< V > Class Template Referenceabstract

A Future where one can asynchronously listen on completion. More...

#include <ICompletableFuture.h>

+ Inheritance diagram for hazelcast::client::ICompletableFuture< V >:

Public Member Functions

virtual void andThen (const boost::shared_ptr< ExecutionCallback< V > > &callback)=0
 Registers a callback that will run after this future is completed. More...
 
virtual void andThen (const boost::shared_ptr< ExecutionCallback< V > > &callback, const boost::shared_ptr< Executor > &executor)=0
 Registers a callback that will run with the provided executor after this future is completed. More...
 
- Public Member Functions inherited from hazelcast::client::IFuture< V >
virtual bool cancel (bool mayInterruptIfRunning)=0
 Attempts to cancel execution of this task. More...
 
virtual bool isCancelled ()=0
 Returns. More...
 
virtual bool isDone ()=0
 Returns. More...
 
virtual boost::shared_ptr< V > get ()=0
 Waits if necessary for the computation to complete, and then retrieves its result. More...
 
virtual boost::shared_ptr< V > get (int64_t timeout, const TimeUnit &unit)=0
 Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. More...
 

Detailed Description

template<typename V>
class hazelcast::client::ICompletableFuture< V >

A Future where one can asynchronously listen on completion.

This functionality is needed for the reactive programming model.

Parameters
<V>The result type returned by this Future's
get
method

Member Function Documentation

◆ andThen() [1/2]

template<typename V >
virtual void hazelcast::client::ICompletableFuture< V >::andThen ( const boost::shared_ptr< ExecutionCallback< V > > &  callback)
pure virtual

Registers a callback that will run after this future is completed.

If this future is already completed, it runs immediately.

Please note that there is no ordering guarantee for running multiple callbacks. It is also not guaranteed that the callback will run within the same thread that completes the future.

Parameters
callbackthe callback to execute

◆ andThen() [2/2]

template<typename V >
virtual void hazelcast::client::ICompletableFuture< V >::andThen ( const boost::shared_ptr< ExecutionCallback< V > > &  callback,
const boost::shared_ptr< Executor > &  executor 
)
pure virtual

Registers a callback that will run with the provided executor after this future is completed.

If this future is already completed, it runs immediately. The callback is called using the given

executor

.

Please note that there is no ordering guarantee for executing multiple callbacks.

Parameters
callbackthe callback to execute
executorthe executor in which the callback will be run

The documentation for this class was generated from the following file: