dml_util.core.state#

State management for DaggerML runners.

This module provides classes for managing state across different runners. The state management system allows runners to store and retrieve state information, which is particularly useful for long-running or distributed tasks.

Classes

LocalState(cache_key)

Local filesystem-based state management.

State()

Base class for state management.

class dml_util.core.state.LocalState(cache_key)[source]#

Bases: State

Local filesystem-based state management.

This class implements state management using the local filesystem. State is stored as JSON files in a cache directory.

Parameters:

cache_key (str) – Unique identifier for the state file.

state_file#

Path to the JSON file where state is stored.

Type:

Path

cache_key: str#
delete()[source]#

Delete state file.

get()[source]#

Read state from file.

put(state)[source]#

Write state to file.

state_file: str#
unlock()[source]#

No-op for local state.

class dml_util.core.state.State[source]#

Bases: object

Base class for state management.

This is an abstract base class that defines the interface for state management. Concrete implementations should provide methods for storing, retrieving, and deleting state information.

put(state)[source]#

Store state information.

get()[source]#

Retrieve state information.

delete()[source]#

Delete state information.

unlock()[source]#

Release any locks on the state.

delete()[source]#

Delete state information.

get()[source]#

Retrieve state information.

put(state)[source]#

Store state information.

unlock()[source]#

Release any locks on the state.