Skip to main content

ContextConfig

Type Alias ContextConfig 

Source
pub type ContextConfig = ChildConfig;
Expand description

Type alias for ChildConfig for consistency with the design document.

The design document refers to this as ContextConfig, but internally we use ChildConfig to be more descriptive of its purpose.

Aliased Type§

pub struct ContextConfig {
    pub serdes: Option<Arc<dyn SerDesAny>>,
    pub replay_children: bool,
    pub error_mapper: Option<Arc<dyn Fn(DurableError) -> DurableError + Send + Sync>>,
    pub summary_generator: Option<Arc<dyn Fn(&str) -> String + Send + Sync>>,
}

Fields§

§serdes: Option<Arc<dyn SerDesAny>>

Optional custom serializer/deserializer.

§replay_children: bool

Whether to replay children when loading state.

When set to true, the child context will request child operations to be included in state loads during replay. This is useful for large parallel operations where the combined output needs to be reconstructed by replaying each branch.

Default is false for better performance in most cases.

§error_mapper: Option<Arc<dyn Fn(DurableError) -> DurableError + Send + Sync>>

Optional function to map child context errors before propagation.

When set, this function is applied to errors from child context execution before they are checkpointed and propagated. Suspend errors are never mapped.

Default is None, which preserves current behavior (errors propagate unchanged).

§summary_generator: Option<Arc<dyn Fn(&str) -> String + Send + Sync>>

Optional function to generate a summary when the serialized child result exceeds 256KB.

When set, this function is invoked with the serialized result string if its size exceeds 256KB (262144 bytes). The returned summary string is stored instead of the full result, enabling replay-based reconstruction for large payloads.

When the serialized result is 256KB or less, the full result is stored even if a summary generator is configured.

Default is None, which preserves current behavior (full result stored regardless of size).