Executor¶
- class Executor(service_name: str, name: str, context)[source]¶
Bases:
hazelcast.proxy.base.Proxy
[BlockingExecutor
]An object that executes submitted executable tasks.
- execute_on_key_owner(key: Any, task: Any) hazelcast.future.Future[Any] [source]¶
Executes a task on the owner of the specified key.
- Parameters
key – The specified key.
task – A task executed on the owner of the specified key.
- Returns
The result of the task.
- execute_on_member(member: hazelcast.core.MemberInfo, task: Any) hazelcast.future.Future[Any] [source]¶
Executes a task on the specified member.
- Parameters
member – The specified member.
task – The task executed on the specified member.
- Returns
The result of the task.
- execute_on_members(members: Sequence[hazelcast.core.MemberInfo], task: Any) hazelcast.future.Future[List[Any]] [source]¶
Executes a task on each of the specified members.
- Parameters
members – The specified members.
task – The task executed on the specified members.
- Returns
The list of results of the tasks on each member.
- execute_on_all_members(task: Any) hazelcast.future.Future[List[Any]] [source]¶
Executes a task on all the known cluster members.
- Parameters
task – The task executed on the all the members.
- Returns
The list of results of the tasks on each member.
- is_shutdown() hazelcast.future.Future[bool] [source]¶
Determines whether this executor has been shutdown or not.
- Returns
True
if the executor has been shutdown,False
otherwise.
- shutdown() hazelcast.future.Future[None] [source]¶
Initiates a shutdown process which works orderly. Tasks that were submitted before shutdown are executed but new task will not be accepted.
- blocking() hazelcast.proxy.executor.BlockingExecutor [source]¶
Returns a version of this proxy with only blocking method calls.
- class BlockingExecutor(wrapped: hazelcast.proxy.executor.Executor)[source]¶
Bases:
hazelcast.proxy.executor.Executor
- name¶
- service_name¶
- execute_on_key_owner(key: Any, task: Any) Any [source]¶
Executes a task on the owner of the specified key.
- Parameters
key – The specified key.
task – A task executed on the owner of the specified key.
- Returns
The result of the task.
- execute_on_member(member: hazelcast.core.MemberInfo, task: Any) Any [source]¶
Executes a task on the specified member.
- Parameters
member – The specified member.
task – The task executed on the specified member.
- Returns
The result of the task.
- execute_on_members(members: Sequence[hazelcast.core.MemberInfo], task: Any) List[Any] [source]¶
Executes a task on each of the specified members.
- Parameters
members – The specified members.
task – The task executed on the specified members.
- Returns
The list of results of the tasks on each member.
- execute_on_all_members(task: Any) List[Any] [source]¶
Executes a task on all the known cluster members.
- Parameters
task – The task executed on the all the members.
- Returns
The list of results of the tasks on each member.
- is_shutdown() bool [source]¶
Determines whether this executor has been shutdown or not.
- Returns
True
if the executor has been shutdown,False
otherwise.
- shutdown() None [source]¶
Initiates a shutdown process which works orderly. Tasks that were submitted before shutdown are executed but new task will not be accepted.
- blocking() hazelcast.proxy.executor.BlockingExecutor [source]¶
Returns a version of this proxy with only blocking method calls.