thread_chunks.LabelledActor¶
- class thread_chunks.LabelledActor(func: Callable)[source]¶
Bases:
objectA ray actor that can execute the function func along with a label to allow an ordering of calls to be re-established. Additionally, as the actor stores func so that copying of func only occurs on initialisation opposed to every call of func.
Methods
Initialises a
LabelledActorGets the function func stored by the actor.
A wrapping that allows labelled execution of the function.
Updates the function func stored by the actor.
- __init__(func: Callable)[source]¶
Initialises a
LabelledActor- Parameters:
func (Callable) – The function saved by the actor.
- get_func() Callable[source]¶
Gets the function func stored by the actor.
- Returns:
The stored function.
- Return type:
Callable
- run(label: Any, *args: Any) Tuple[Any, Any][source]¶
A wrapping that allows labelled execution of the function.
- Parameters:
label (Any) – The label assigned to the execution.
*args (Any) – The arguments to pass to the stored function func.
- Returns:
The label followed by the return of func.
- Return type:
Tuple[Any, Any]