A Subscriber should allow to create subscriptions to new changes happening in the EventStore.
Changes received from the Subscriber should start from when the subscription has started, onwards.
The base idea of a Subscriber is very similar to the EventStore, looking like this:
pub trait Subscriber {
type SourceId: Eq;
type Event;
type Error;
fn subscribe_all(&self) -> BoxFuture<Result<EventStream<Self>, Self::Error>>;
// We can provide a default implementation using `subscribe_all`
fn subscribe(&self, id: Self::SourceId) -> BoxFuture<EventStream<Self>, Self::Error>;
}
The Subscriber can then be used to attach Publishers to relay the events onto message brokers (e.g. Kafka, RabbitMQ), or to run Projectors.
A
Subscribershould allow to create subscriptions to new changes happening in theEventStore.Changes received from the
Subscribershould start from when the subscription has started, onwards.The base idea of a
Subscriberis very similar to theEventStore, looking like this:The
Subscribercan then be used to attachPublishers to relay the events onto message brokers (e.g. Kafka, RabbitMQ), or to runProjectors.