# README
Foreman
What is Foreman? A library that helps you build an event driven application by handling all the complexity of decoding, routing, dispatching and executing commands or subscribing for events. By having Publish/Subscribe and MessageBus patterns you could build different components on top for various architecture approaches like orchestrated sagas or workflows.
Pub/Sub features:
- configurable pool of workers for concurrent processing, high throughput
- graceful shutdown
- dynamic encoding/decoding of data structs
- message dispatcher
- transport interface: AMQP implementation
Orchestrated sagas:
- workflow as code
- compensate & recover triggers
- saga store: mysql/pg
- history of events
- embed sagas as subtasks of parent saga
- HTTP API dashboard
Roadmap:
- Apache Kafka transport
- protobuf message encoder
License:
The MIT License (MIT). Please see LICENSE for more information.
# Functions
DefaultSubscriber option allows to specify your own transport which will be used in the default subscriber.
NewMessageBus constructs MessageBus, allows to specify logger, choose subscriber or use default with transport and other options which configure implementations of other important parts.
WithComponents specifies a list of additional components you want to be registered in MessageBus.
WithDispatcher allows to provide another dispatcher.Dispatcher implementation.
WithMessageExecutionFactory allows to provide own execution.MessageExecutionCtxFactory.
WithRouter allows to provide another endpoint.Router implementation.
WithSubscriber option allows to specify your own implementation of Subscriber for MessageBus.
WithSubscriberFactory provides a way to construct your own Subscriber and pass it along to MessageBus.
# Structs
MessageBus is a main component, kind of a container which aggregates other components.
# Interfaces
Component allow to wrap and prepare booting of your component, which will be initialized by MessageBus.
# Type aliases
ConfigOption allows to configure MessageBus's container.
SubscriberFactory is a function which gives you an access to default Processor and message.Decoder, these are needed when you implement own Subscriber.
SubscriberOption allows to provide a few options for configuring Subscriber.