Module zerocopy

Module zerocopy 

Source
Expand description

Zero-copy deserialization for performance optimization

This module provides zero-copy deserialization capabilities using Cow (Copy-on-Write) to avoid unnecessary data copying during deserialization. This is particularly useful for large message bodies where avoiding copies can significantly improve performance.

§Examples

use celers_protocol::zerocopy::{MessageRef, TaskArgsRef};
use uuid::Uuid;

// Create a zero-copy message reference
let task_id = Uuid::new_v4();
let body = b"{\"args\":[1,2],\"kwargs\":{}}";
let msg = MessageRef::new("tasks.add", task_id, body);

assert_eq!(msg.task_name(), "tasks.add");
assert_eq!(msg.task_id(), task_id);

Structs§

MessageHeadersRef
Zero-copy message headers
MessagePropertiesRef
Zero-copy message properties
MessageRef
Zero-copy Celery message
TaskArgsRef
Zero-copy task arguments