Module embed

Module embed 

Source
Expand description

Celery embedded body format

This module provides support for the Celery Protocol v2 embedded body format. In Protocol v2, the message body is a tuple of [args, kwargs, embed] where:

  • args - Positional arguments (list)
  • kwargs - Keyword arguments (dict)
  • embed - Embedded metadata (callbacks, errbacks, chain, chord, etc.)

§Example

use celers_protocol::embed::{EmbeddedBody, EmbedOptions};
use serde_json::json;

let body = EmbeddedBody::new()
    .with_args(vec![json!(1), json!(2)])
    .with_kwarg("debug", json!(true));

let encoded = body.encode().unwrap();
let decoded = EmbeddedBody::decode(&encoded).unwrap();
assert_eq!(decoded.args, vec![json!(1), json!(2)]);

Structs§

CallbackSignature
Callback signature for link/errback
EmbedOptions
Embed options in the message body
EmbeddedBody
Complete embedded body format [args, kwargs, embed]

Functions§

format_args
Serialize arguments for display/logging