Skip to main content

Module checkpoint_server

Module checkpoint_server 

Source
Expand description

Checkpoint server module for local testing (Node.js SDK parity).

This module implements a checkpoint server that runs in a separate thread, matching the architecture of the Node.js SDK’s CheckpointWorkerManager. It provides full execution state management for realistic local testing.

§Architecture

The checkpoint server consists of several components:

  • CheckpointWorkerManager: Manages the lifecycle of the checkpoint server thread
  • ExecutionManager: Manages the state of all executions
  • CheckpointManager: Manages checkpoints for a single execution
  • CallbackManager: Manages callback lifecycle including timeouts and heartbeats
  • EventProcessor: Generates history events for execution tracking

§Communication

The main thread communicates with the checkpoint server thread via channels:

  • Requests are sent via mpsc::Sender<WorkerRequest>
  • Responses are received via mpsc::Receiver<WorkerResponse>

Re-exports§

pub use callback_manager::CallbackManager;
pub use callback_manager::CallbackState;
pub use callback_manager::CompleteCallbackStatus;
pub use checkpoint_manager::CheckpointManager;
pub use checkpoint_manager::CheckpointOperation;
pub use checkpoint_manager::InvocationTimestamps;
pub use checkpoint_manager::OperationEvents;
pub use checkpoint_token::decode_checkpoint_token;
pub use checkpoint_token::encode_checkpoint_token;
pub use checkpoint_token::CheckpointTokenData;
pub use event_processor::EventProcessor;
pub use event_processor::EventType;
pub use event_processor::HistoryEvent;
pub use execution_manager::ExecutionManager;
pub use execution_manager::InvocationResult;
pub use nodejs_event_types::CallbackFailedDetails;
pub use nodejs_event_types::CallbackFailedDetailsWrapper;
pub use nodejs_event_types::CallbackStartedDetails;
pub use nodejs_event_types::CallbackStartedDetailsWrapper;
pub use nodejs_event_types::CallbackSucceededDetails;
pub use nodejs_event_types::CallbackSucceededDetailsWrapper;
pub use nodejs_event_types::ContextFailedDetails;
pub use nodejs_event_types::ContextFailedDetailsWrapper;
pub use nodejs_event_types::ContextStartedDetails;
pub use nodejs_event_types::ContextStartedDetailsWrapper;
pub use nodejs_event_types::ContextSucceededDetails;
pub use nodejs_event_types::ContextSucceededDetailsWrapper;
pub use nodejs_event_types::EmptyDetails;
pub use nodejs_event_types::ErrorWrapper;
pub use nodejs_event_types::ExecutionFailedDetails;
pub use nodejs_event_types::ExecutionFailedDetailsWrapper;
pub use nodejs_event_types::ExecutionStartedDetails;
pub use nodejs_event_types::ExecutionStartedDetailsWrapper;
pub use nodejs_event_types::ExecutionSucceededDetails;
pub use nodejs_event_types::ExecutionSucceededDetailsWrapper;
pub use nodejs_event_types::InvocationCompletedDetails;
pub use nodejs_event_types::InvocationCompletedDetailsWrapper;
pub use nodejs_event_types::NodeJsEventDetails;
pub use nodejs_event_types::NodeJsEventType;
pub use nodejs_event_types::NodeJsHistoryEvent;
pub use nodejs_event_types::PayloadWrapper;
pub use nodejs_event_types::RetryDetails;
pub use nodejs_event_types::StepFailedDetails;
pub use nodejs_event_types::StepFailedDetailsWrapper;
pub use nodejs_event_types::StepStartedDetails;
pub use nodejs_event_types::StepStartedDetailsWrapper;
pub use nodejs_event_types::StepSucceededDetails;
pub use nodejs_event_types::StepSucceededDetailsWrapper;
pub use nodejs_event_types::WaitStartedDetails;
pub use nodejs_event_types::WaitStartedDetailsWrapper;
pub use nodejs_event_types::WaitSucceededDetails;
pub use nodejs_event_types::WaitSucceededDetailsWrapper;
pub use orchestrator::BoxedHandler;
pub use orchestrator::InvokeHandlerResult;
pub use orchestrator::OperationProcessResult;
pub use orchestrator::OperationStorage;
pub use orchestrator::ProcessOperationsResult;
pub use orchestrator::SkipTimeConfig;
pub use orchestrator::TestExecutionOrchestrator;
pub use orchestrator::TestExecutionResult;
pub use scheduler::BoxedAsyncFn;
pub use scheduler::CheckpointUpdateFn;
pub use scheduler::ErrorHandler;
pub use scheduler::QueueScheduler;
pub use scheduler::ScheduledFunction;
pub use scheduler::Scheduler;
pub use scheduler::TimerScheduler;
pub use types::ApiType;
pub use types::CheckpointWorkerParams;
pub use types::StartDurableExecutionRequest;
pub use types::WorkerApiRequest;
pub use types::WorkerApiResponse;
pub use types::WorkerCommand;
pub use types::WorkerCommandType;
pub use types::WorkerResponse;
pub use types::WorkerResponseType;
pub use worker_manager::CheckpointWorkerManager;

Modules§

callback_manager
Callback manager for managing callback lifecycle.
checkpoint_manager
Checkpoint manager for managing checkpoints of a single execution.
checkpoint_token
Checkpoint token encoding and decoding utilities.
event_processor
Event processor for generating history events.
execution_manager
Execution manager for managing the state of all executions.
nodejs_event_types
Node.js SDK compatible event types for history tracking.
orchestrator
Test execution orchestrator for managing the full execution lifecycle.
scheduler
Scheduler implementations for test execution orchestration.
types
Shared types for the checkpoint server module.
worker_manager
Checkpoint worker manager for managing the checkpoint server thread.