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
//! # Parliament Traits
//!
//! This module defines the abstract interfaces (traits) that form the boundaries
//! of the Parliament's core logic. These are the "Ports" in a Hexagonal
//! Architecture, allowing the core domain to remain agnostic of the specific
//! infrastructure used for communication and persistence.
use crate::;
use async_trait;
use Bytes;
/// An interface for a persistent, ordered event log.
///
/// This trait represents the capability to record immutable facts (`Echo` events)
/// into the system's source of truth. An adapter for Fluvio, Kafka, or a
/// database would implement this trait.
/// A trait describing the capability to dispatch formal commands (`Writs`)
/// into the communication fabric of the Parliament.
///
/// This trait represents the capability to send messages, not a specific
/// topology like a "bus". An adapter for a NATS supercluster or another
/// message mesh would implement this trait.
/// A trait for a long-running, stateful process. A Hunt is the core
/// unit of value creation in the Parliament.
///
/// Implementors of this trait represent a specific business process, managing
/// their own state (`Vigil`) and interacting with the rest of the system
/// via the `WritDispatcher` and `EventStream`.