Skip to content

HubBackedCheckpointStore

autogen.beta.network.client.checkpoint.HubBackedCheckpointStore #

HubBackedCheckpointStore(hub)

Persists task checkpoints through a :class:Hub instance.

Satisfies the framework-core :class:CheckpointStore Protocol by delegating to :meth:Hub.checkpoint_task and :meth:Hub.read_task_checkpoint through an in-process hub reference. Deployments that need different durability supply another :class:CheckpointStore — the Protocol is the seam.

Source code in autogen/beta/network/client/checkpoint.py
def __init__(self, hub: "Hub") -> None:
    # __init__ stores params; no side effects.
    self._hub = hub

write async #

write(task_id, state)
Source code in autogen/beta/network/client/checkpoint.py
async def write(self, task_id: str, state: dict[str, Any]) -> None:
    await self._hub.checkpoint_task(task_id, dict(state))

read async #

read(task_id)
Source code in autogen/beta/network/client/checkpoint.py
async def read(self, task_id: str) -> dict[str, Any] | None:
    return await self._hub.read_task_checkpoint(task_id)