Module distributed

Module distributed 

Source
Expand description

Distributed Context Sharing

This module provides distributed context management for sharing state across microservices in a distributed system.

§Features

  • Context Serialization: Efficient serialization for remote execution
  • State Sharing: Share context between microservices
  • Distributed Caching: Redis/Memcached integration
  • Versioning: Context versioning with conflict resolution

§Example

use rust_logic_graph::distributed::{DistributedContext, ContextStore};
use serde_json::json;

// Create distributed context with versioning
let mut context = DistributedContext::new("session-123");
context.set("user_id", json!("user-456"));
context.set("tenant", json!("acme-corp"));

// Serialize for transmission
let serialized = context.serialize()?;

// Deserialize on remote service
let remote_context = DistributedContext::deserialize(&serialized)?;

Re-exports§

pub use context::ContextSnapshot;
pub use context::DistributedContext;
pub use context::SharedContext;
pub use store::ContextStore;
pub use store::InMemoryStore;
pub use cache::CacheStrategy;
pub use cache::CacheWarmer;
pub use cache::DistributedCache;
pub use store::MemcachedStore;
pub use versioning::ConflictResolution;
pub use versioning::ContextVersion;
pub use versioning::ThreeWayMerge;
pub use versioning::VersionedContext;

Modules§

cache
Distributed Caching for Contexts
context
Distributed Context with Serialization
store
Context Store Implementations
versioning
Context Versioning and Conflict Resolution