flowd 0.2.0

Redis Streams-backed task queue with a derive macro for automatic struct ↔ redis::Value mapping. Supports tokio and smol.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::Job;

/// A single unit of work to be enqueued into a Redis Stream.
///
/// The `id` is passed directly to `XADD` as the message ID. Use `"*"` to
/// let Redis auto-generate a timestamp-based ID.
pub struct Task<T: Job> {
   /// Stream message ID (e.g. `"*"` for auto-generated, or a specific ID).
   pub id: String,
   /// The payload to serialize into stream fields via [`Job`].
   pub payload: T,
}