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
//! The imports a service spanning both transport forms writes every time, in one glob.
//!
//! The framework's prelude, this crate's broker, descriptor, position, seeker and policy types,
//! the seeking capability traits and context keys, and the [`mod@file`] and [`stdio`] modules. A
//! service on one form globs that form's prelude instead, where the policy is named by concept
//! (`file::Publish`, `stdio::Publish`); a mount site that spans both forms writes the prefixed
//! names, since the two forms would claim the same one here. The
//! [Prelude](https://powersemmi.github.io/ruststream-sea-file/latest/components/broker/prelude/)
//! page shows the three preludes in a service.
//!
//! # Examples
//!
//! ```
//! use ruststream_sea_file::prelude::*;
//! use serde::{Deserialize, Serialize};
//!
//! #[derive(Debug, Deserialize)]
//! struct Order {
//! id: u64,
//! }
//!
//! #[derive(Debug, Outgoing, Serialize)]
//! struct Receipt {
//! order: u64,
//! }
//!
//! #[subscriber(
//! FileStream::new("orders"),
//! start_at(FilePosition::beginning()),
//! reply("receipts")
//! )]
//! async fn record(order: &Order) -> Receipt {
//! Receipt { order: order.id }
//! }
//!
//! #[subscriber("orders", reply("receipts"))]
//! async fn tee(order: &Order) -> Receipt {
//! Receipt { order: order.id }
//! }
//!
//! #[ruststream::app]
//! fn app() -> impl App {
//! RustStream::new(AppInfo::new("orders", "0.1.0"))
//! .with_broker(FileBroker::new("/tmp/orders.ss"), |b| {
//! b.include(record).out_reply(FilePublish);
//! })
//! .with_broker(StdioBroker::new(), |b| {
//! b.include(tee)
//! .out_reply(StdioPublish)
//! .out_retry(StdioPublish)
//! .to("orders.retry");
//! })
//! }
//! ```
pub use *;
pub use ;
pub use crate::;
pub use crate::;
// No bare `Publish` here: the two forms disagree on what it names, so a mixed mount site goes
// through `FilePublish` / `StdioPublish` (or `file::Publish` / `stdio::Publish` by path) - do not
// add one.