Expand description
Protocol version negotiation and detection
This module provides utilities for detecting and negotiating Celery protocol versions between CeleRS and Python Celery workers/clients.
§Protocol Versions
- Protocol v1: Legacy format (Celery 3.x and earlier) - Not supported
- Protocol v2: Current stable format (Celery 4.x+) - Fully supported
- Protocol v5: Extended format (Celery 5.x+) - Fully supported
§Example
use celers_protocol::negotiation::{ProtocolNegotiator, negotiate_protocol};
use celers_protocol::ProtocolVersion;
// Negotiate between supported versions
let negotiator = ProtocolNegotiator::new()
.prefer(ProtocolVersion::V5)
.support(ProtocolVersion::V2);
let agreed = negotiator.negotiate(&[ProtocolVersion::V2]).unwrap();
assert_eq!(agreed, ProtocolVersion::V2);Structs§
- Protocol
Capabilities - Protocol capabilities
- Protocol
Detection - Protocol detection result
- Protocol
Negotiator - Protocol negotiator for version agreement
Enums§
- Detection
Method - Method used for protocol detection
- Negotiation
Error - Protocol negotiation error
Functions§
- detect_
protocol - Detect protocol version from a JSON message
- detect_
protocol_ from_ bytes - Detect protocol version from message bytes
- negotiate_
protocol - Simple negotiation helper function