Skip to main content

Crate juncture_checkpoint

Crate juncture_checkpoint 

Source
Expand description

Juncture checkpoint persistence

This crate provides checkpoint persistence for Juncture state machine executions. It enables time-travel debugging, crash recovery, and human-in-the-loop workflows.

§Overview

Checkpoint persistence captures the complete state of graph execution at specific points, allowing execution to be paused, resumed, or rolled back to any previous state.

§Core Components

§Example

use juncture_checkpoint::MemorySaver;
use juncture_core::{RunnableConfig, checkpoint::CheckpointSaver};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let saver = MemorySaver::new();
    let config = RunnableConfig::default().with_thread_id("my-thread");

    // Save a checkpoint
    let checkpoint = /* create checkpoint */;
    let metadata = /* create metadata */;
    let updated_config = saver.put(&config, checkpoint, metadata).await?;

    // Retrieve latest checkpoint
    let tuple = saver.get_tuple(&updated_config).await?.unwrap();

    Ok(())
}

Re-exports§

pub use cache::BaseCache;
pub use cache::MemoryCache;
pub use error::CheckpointError;
pub use memory::MemorySaver;
pub use serde::CheckpointSerializer;
pub use serde::JsonPlusSerializer;
pub use serde::JsonSerializer;
pub use serde::MsgpackSerializer;
pub use serde::SerializationFormat;
pub use serde::SerializerKind;
pub use serde::deserialize_auto;
pub use serde::detect_format;
pub use types::*;

Modules§

cache
Caching layer for checkpoint storage
error
Checkpoint error types
memory
In-memory checkpoint storage
serde
Checkpoint serialization
types
Checkpoint data structures

Traits§

CheckpointSaver
Checkpoint persistence interface