Hazelcast C++ Client
|
Distributed implementation of java.util.concurrent.ExecutorService. More...
#include <iexecutor_service.h>
Classes | |
class | executor_promise |
Public Member Functions | |
template<typename HazelcastSerializable > | |
void | execute (const HazelcastSerializable &command) |
Executes the given command at some time in the future. More... | |
template<typename HazelcastSerializable > | |
void | execute (const HazelcastSerializable &command, const member_selector &member_selector) |
Executes a task on a randomly selected member. More... | |
template<typename HazelcastSerializable , typename K > | |
void | execute_on_key_owner (const HazelcastSerializable &command, const K &key) |
Executes a task on the owner of the specified key. More... | |
template<typename HazelcastSerializable > | |
void | execute_on_member (const HazelcastSerializable &command, const member &member) |
Executes a task on the specified member. More... | |
template<typename HazelcastSerializable > | |
void | execute_on_members (const HazelcastSerializable &command, const std::vector< member > &members) |
Executes a task on each of the specified members. More... | |
template<typename HazelcastSerializable > | |
void | execute_on_members (const HazelcastSerializable &command, const member_selector &member_selector) |
Executes a task on each of the selected members. More... | |
template<typename HazelcastSerializable > | |
void | execute_on_all_members (const HazelcastSerializable &command) |
Executes a task on all of the known cluster members. More... | |
template<typename HazelcastSerializable , typename T , typename K > | |
executor_promise< T > | submit_to_key_owner (const HazelcastSerializable &task, const K &key) |
Submits a task to the owner of the specified key and returns a executor_promise representing that task. More... | |
template<typename HazelcastSerializable , typename T > | |
executor_promise< T > | submit_to_member (const HazelcastSerializable &task, const member &member) |
Submits a task to the specified member and returns a executor_promise representing that task. More... | |
template<typename HazelcastSerializable , typename T > | |
std::unordered_map< member, executor_promise< T > > | submit_to_members (const HazelcastSerializable &task, const std::vector< member > &members) |
Submits a task to given members and returns map of Member-executor_promise pairs representing pending completion of the task on each member. More... | |
template<typename HazelcastSerializable , typename T > | |
std::unordered_map< member, executor_promise< T > > | submit_to_members (const HazelcastSerializable &task, const member_selector &member_selector) |
Submits a task to selected members and returns a map of Member-executor_promise pairs representing pending completion of the task on each member. More... | |
template<typename HazelcastSerializable , typename T > | |
std::unordered_map< member, executor_promise< T > > | submit_to_all_members (const HazelcastSerializable &task) |
Submits task to all cluster members and returns a map of Member-executor_promise pairs representing pending completion of the task on each member. More... | |
template<typename HazelcastSerializable , typename T > | |
executor_promise< T > | submit (const HazelcastSerializable &task) |
Submits a task for execution and returns a executor_promise representing that task. More... | |
template<typename HazelcastSerializable , typename T > | |
executor_promise< T > | submit (const HazelcastSerializable &task, const member_selector &member_selector) |
Submits a task to a randomly selected member and returns a executor_promise representing that task. More... | |
void | shutdown () |
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. More... | |
boost::future< bool > | is_shutdown () |
Returns. More... | |
boost::future< bool > | is_terminated () |
Returns. More... | |
Static Public Attributes | |
static constexpr const char * | SERVICE_NAME = "hz:impl:executorService" |
Friends | |
class | spi::ProxyManager |
Distributed implementation of java.util.concurrent.ExecutorService.
IExecutorService provides additional methods like executing tasks on a specific member, on a member who is owner of a specific key, executing a tasks on multiple members.
|
inline |
Executes the given command at some time in the future.
The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the
implementation.
command | the runnable task |
rejected_execution | if this task cannot be accepted for execution |
|
inline |
Executes a task on a randomly selected member.
command | the task that is executed on a randomly selected member |
memberSelector | memberSelector |
rejected_execution | if no member is selected |
|
inline |
Executes a task on all of the known cluster members.
command | a task executed on all of the known cluster members |
|
inline |
Executes a task on the owner of the specified key.
command | a task executed on the owner of the specified key |
key | the specified key |
|
inline |
Executes a task on the specified member.
command | the task executed on the specified member |
member | the specified member |
|
inline |
Executes a task on each of the specified members.
command | the task executed on the specified members |
members | the specified members |
|
inline |
Executes a task on each of the selected members.
command | a task executed on each of the selected members |
memberSelector | memberSelector |
rejected_execution | if no member is selected |
boost::future< bool > hazelcast::client::iexecutor_service::is_shutdown | ( | ) |
Returns.
if this executor has been shut down.
boost::future< bool > hazelcast::client::iexecutor_service::is_terminated | ( | ) |
Returns.
if all tasks have completed following shut down. Note that
is never
unless either
.
void hazelcast::client::iexecutor_service::shutdown | ( | ) |
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
Invocation has no additional effect if already shut down.
This method does not wait for previously submitted tasks to complete execution.
|
inline |
Submits a task for execution and returns a executor_promise representing that task.
The executor_promise's
method will return the given result upon successful completion.
task | the task to submit |
result | the result to return |
<T> | the type of the result |
rejected_execution | if the task cannot be scheduled for execution |
null_pointer | if the task is null |
|
inline |
Submits a task to a randomly selected member and returns a executor_promise representing that task.
task | task submitted to a randomly selected member |
memberSelector | memberSelector |
<T> | the result type of callable |
rejected_execution | if no member is selected |
|
inline |
Submits task to all cluster members and returns a map of Member-executor_promise pairs representing pending completion of the task on each member.
task | the task submitted to all cluster members |
<T> | the result type of callable |
|
inline |
Submits a task to the owner of the specified key and returns a executor_promise representing that task.
task | task submitted to the owner of the specified key |
key | the specified key |
<T> | the result type of callable |
|
inline |
Submits a task to the specified member and returns a executor_promise representing that task.
task | the task submitted to the specified member |
member | the specified member |
<T> | the result type of callable |
|
inline |
Submits a task to given members and returns map of Member-executor_promise pairs representing pending completion of the task on each member.
task | the task submitted to given members |
members | the given members |
<T> | the result type of callable |
|
inline |
Submits a task to selected members and returns a map of Member-executor_promise pairs representing pending completion of the task on each member.
task | the task submitted to selected members |
memberSelector | memberSelector |
<T> | the result type of callable |
rejected_execution | if no member is selected |