Base
- class mosaic.core.base.CMDBase(*args, **kwargs)[source]
Bases:
Base
Base class for objects that accept remote commands, such as tesserae and tasks, and their proxies.
- cmd(method, *args, **kwargs)[source]
Send command to remote counterparts.
- Parameters:
method (str) – Method of the command.
args (tuple, optional) – Arguments for the command.
kwargs (optional) – Keyword arguments for the command.
- Return type:
concurrent.futures.Future
- async cmd_async(method, *args, **kwargs)[source]
Send async command to remote counterparts.
- Parameters:
method (str) – Method of the command.
args (tuple, optional) – Arguments for the command.
kwargs (optional) – Keyword arguments for the command.
- Return type:
asyncio.Future
- cmd_recv(method, *args, **kwargs)[source]
Send command to remote counterparts and await reply.
- Parameters:
method (str) – Method of the command.
args (tuple, optional) – Arguments for the command.
kwargs (optional) – Keyword arguments for the command.
- Return type:
reply
- async cmd_recv_async(method, *args, **kwargs)[source]
Send async command to remote counterparts and await reply.
- Parameters:
method (str) – Method of the command.
args (tuple, optional) – Arguments for the command.
kwargs (optional) – Keyword arguments for the command.
- Return type:
asyncio.Future
- property collectable
Whether the object is ready for collection.
- property init_future
Init state of the object.
- is_proxy = False
- is_remote = False
- property remote_runtime
Proxy to runtime where remote counterpart(s) is(are).
- property runtime_id
Runtime ID where remote object resides.
- property state
Object state.
- type = 'none'
- property uid
Object UID.
- class mosaic.core.base.RemoteBase(uid, *args, **kwargs)[source]
Bases:
CMDBase
Base class for CMD objects that live in a remote runtime (e.g. tesserae and tasks).
- is_proxy = False
- is_remote = True
- property proxies
Set of proxies that keep references to this remote.
- property remote_runtime
Proxy to runtime where remote counterpart(s) is(are).
- property runtime_id
Runtime ID where remote object resides.
- class mosaic.core.base.ProxyBase(*args, **kwargs)[source]
Bases:
CMDBase
Base class for CMD objects that represent proxies to remote objects (e.g. tessera proxies and task proxies).
- is_proxy = True
- is_remote = False
- property remote_runtime
Proxy to runtime where remote counterpart(s) is(are).
- property runtime_id
Runtime ID where remote object resides.