Module migration

Module migration 

Source
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§

CompatibilityInfo
Migration compatibility information
MigrationStep
Migration step
ProtocolMigrator
Protocol migrator for version transitions

Enums§

MigrationError
Migration error
MigrationStrategy
Migration strategy

Functions§

create_migration_plan
Helper function to create a migration plan