Expand description
Protocol version migration helpers
This module provides utilities for migrating messages between different Celery protocol versions (v2 and v5).
§Example
use celers_protocol::migration::{ProtocolMigrator, MigrationStrategy};
use celers_protocol::{ProtocolVersion, Message, TaskArgs};
use uuid::Uuid;
let task_id = Uuid::new_v4();
let body = serde_json::to_vec(&TaskArgs::new()).unwrap();
let msg = Message::new("tasks.add".to_string(), task_id, body);
let migrator = ProtocolMigrator::new(MigrationStrategy::Conservative);
let info = migrator.check_compatibility(&msg, ProtocolVersion::V5);
assert!(info.is_compatible);Structs§
- Compatibility
Info - Migration compatibility information
- Migration
Step - Migration step
- Protocol
Migrator - Protocol migrator for version transitions
Enums§
- Migration
Error - Migration error
- Migration
Strategy - Migration strategy
Functions§
- create_
migration_ plan - Helper function to create a migration plan