pynenc.call#
Module Contents#
Classes#
Represents a specific call of a task. A call is unique per task and its arguments. |
API#
- class pynenc.call.Call[source]#
Bases:
typing.Generic[pynenc.types.Params,pynenc.types.Result]Represents a specific call of a task. A call is unique per task and its arguments.
- Parameters:
- arguments: pynenc.arguments.Arguments#
‘field(…)’
- app() pynenc.app.Pynenc#
Gets the Pynenc application instance associated with the task.
- Returns:
The Pynenc application instance.
- call_id() str#
Generates a unique identifier for the call based on the task ID and the arguments.
- Returns:
A string representing the unique identifier of the call.
- serialized_arguments() dict[str, str]#
Serializes the call arguments into strings.
- Returns:
A dictionary of serialized argument strings.
- serialized_args_for_concurrency_check() dict[str, str] | None#
Determines the call arguments required for the task concurrency check.
- Returns:
A dictionary of serialized argument strings required for concurrency control, or None if concurrency control is disabled.
- deserialize_arguments(serialized_arguments: dict[str, str]) pynenc.arguments.Arguments[source]#
Deserializes the given serialized arguments.
- to_json() str[source]#
Serializes the call into a JSON string.
- Returns:
A JSON string representing the serialized call.
- __getstate__() dict[source]#
Gets the state of the Call object for serialization purposes.
- Returns:
A dictionary representing the state of the Call object.
- __setstate__(state: dict) None[source]#
Sets the state of the Call object from the provided dictionary.
- Parameters:
state (dict) – A dictionary representing the state to set.
- classmethod from_json(app: pynenc.app.Pynenc, serialized: str) pynenc.call.Call[source]#
Creates a Call object from a serialized JSON string.