Executor¶
- class Executor(service_name, name, context)[source]¶
Bases:
hazelcast.proxy.base.Proxy
An object that executes submitted executable tasks.
- execute_on_key_owner(key, task)[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
future representing pending completion of the task.
- Return type
- execute_on_member(member, task)[source]¶
Executes a task on the specified member.
- Parameters
member (hazelcast.core.MemberInfo) – The specified member.
task – The task executed on the specified member.
- Returns
Future representing pending completion of the task.
- Return type
- execute_on_members(members, task)[source]¶
Executes a task on each of the specified members.
- Parameters
members (list[hazelcast.core.MemberInfo]) – The specified members.
task – The task executed on the specified members.
- Returns
Futures representing pending completion of the task on each member.
- Return type
list[hazelcast.future.Future]
- execute_on_all_members(task)[source]¶
Executes a task on all of the known cluster members.
- Parameters
task – The task executed on the all of the members.
- Returns
Futures representing pending completion of the task on each member.
- Return type
list[hazelcast.future.Future]
- is_shutdown()[source]¶
Determines whether this executor has been shutdown or not.
- Returns
True
if the executor has been shutdown,False
otherwise.- Return type
hazelcast.future.Future[bool]
- shutdown()[source]¶
Initiates a shutdown process which works orderly. Tasks that were submitted before shutdown are executed but new task will not be accepted.
- Returns
- Return type
hazelcast.future.Future[None]