pynenc.context

This module maintains the context of invocations and runners within the Pynenc application.

It stores the current invocation context and runner arguments, facilitating the management and tracking of nested or sub-invocations within different execution environments.

Module Contents

Functions

get_dist_invocation_context

Get the current invocation context for the given app.

swap_dist_invocation_context

Set the current invocation context for the given app and returns the previous.

Data

API

pynenc.context.thread_local

‘local(…)’

pynenc.context.sync_inv_context: dict[str, Optional[pynenc.invocation.sync_invocation.SynchronousInvocation]]

None

pynenc.context.get_dist_invocation_context(app_id: str) Optional[pynenc.invocation.dist_invocation.DistributedInvocation][source]

Get the current invocation context for the given app.

Parameters:

app_id (str) – The app identifier.

Result:

The current invocation context for the given app.

pynenc.context.swap_dist_invocation_context(app_id: str, invocation: Optional[pynenc.invocation.dist_invocation.DistributedInvocation]) Optional[pynenc.invocation.dist_invocation.DistributedInvocation][source]

Set the current invocation context for the given app and returns the previous.

Parameters:
  • app_id (str) – The app identifier.

  • invocation (DistributedInvocation) – The invocation to set as the current context.

pynenc.context.runner_args: Optional[dict[str, Any]]

None