pub type RedisStreamPipeline = Pipelined<RedisStream, Plain>;Expand description
A stream subscription with a window: what .pipeline() at the mount site makes of a RedisStream.
§Examples
use ruststream_fred::stream::prelude::*;
#[subscriber(RedisStream::new("orders").group("workers"))]
async fn record(event: &Event, Ctx(pipeline): Ctx<keys::Pipeline>) -> HandlerOutcome {
if pipeline.incr(format!("seen:{}", event.id)).await.is_err() {
return HandlerOutcome::retry();
}
HandlerOutcome::ack()
}
fn app() -> RustStream {
RustStream::new(AppInfo::new("events", "0.1.0")).with_broker(
RedisBroker::standalone("redis://localhost:6379"),
|b| {
// The source of this registration is a `RedisStreamPipeline`.
b.include(record.pipeline());
},
)
}Aliased Type§
pub struct RedisStreamPipeline { /* private fields */ }