1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! The core prelude plus everything a service mixing all three Redis forms writes.
//!
//! The broker, every descriptor and publish policy, the seek types, the per-delivery and
//! batch contexts with their [`keys`], and the [`crate::stream`], [`crate::list`] and
//! [`crate::pubsub`] modules.
//!
//! # Examples
//!
//! ```
//! # mod demo {
//! use ruststream_fred::prelude::*;
//! use serde::{Deserialize, Serialize};
//!
//! #[derive(Deserialize)]
//! struct Order {
//! id: u64,
//! }
//!
//! #[derive(Serialize, Outgoing)]
//! #[outgoing(name = "orders.shipped")]
//! struct Shipped {
//! id: u64,
//! }
//!
//! #[subscriber(RedisStream::new("orders").group("workers"), reply)]
//! async fn ship(order: &Order) -> Shipped {
//! Shipped { id: order.id }
//! }
//!
//! #[subscriber(RedisList::new("invoices").reliable())]
//! async fn invoice(order: &Order) -> HandlerOutcome {
//! println!("invoicing order {}", order.id);
//! HandlerOutcome::ack()
//! }
//!
//! #[ruststream::app]
//! fn app() -> impl App {
//! RustStream::new(AppInfo::new("orders", "0.1.0")).with_broker(
//! RedisBroker::standalone("redis://localhost:6379"),
//! |b| {
//! // A stream in, a Pub/Sub broadcast out: the form prefix says which `Publish`.
//! b.include(ship).out_reply(pubsub::Publish::default());
//! b.include(invoice);
//! },
//! )
//! }
//! # }
//! # fn main() {}
//! ```
//!
//! A service on a single form globs that form's prelude instead, which carries `Publish` under the
//! uniform mount-site name and only the capabilities that form has.
pub use *;
// Do not add `Partitioned` here: the core surfaces `partition_key` through `IncomingMessage`'s
// defaulted method, which this glob already carries, so re-exporting the trait makes the call
// ambiguous (E0034).
pub use ;
// `keys` arrives as the module, not as a glob: its members are short words a service also uses for
// its own types, and `Ctx<keys::SeekHandle>` reads as what it is at the use site.
pub use crate;
pub use crate;
pub use crate::;
// The policies keep their prefixed names here, and there is no bare `Publish`: this glob spans all
// three forms, so the one mount-site word would name three colliding types. A mixed file globs
// this prelude and writes `stream::Publish` beside `pubsub::Publish` through these modules.
pub use crate::;
pub use crate::;