pynenc.call#

Module Contents#

Classes#

Call

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:
  • task (Task[Params, Result]) – The task associated with the call.

  • arguments (Arguments) – The arguments used in the call. Defaults to an empty Arguments object.

task: Task[Params, Result]#

None

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.

Parameters:

serialized_arguments (dict[str, str]) – The serialized arguments to deserialize.

Returns:

An Arguments object representing the deserialized 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.

Parameters:
  • app (Pynenc) – The Pynenc application instance.

  • serialized (str) – The serialized JSON string representing the call.

Returns:

A Call object created from the serialized data.

__str__() str[source]#
__repr__() str[source]#
__hash__() int[source]#
__eq__(other: Any) bool[source]#