Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
Dispatcher maps event projections to their respective handler functions
type EventStore ¶
type EventStore struct {
Mutex sync.Mutex
Dispatcher *Dispatcher
Events *sync.Pool
}
EventStore handles publishing and dispatching events
func NewEventStore ¶
func NewEventStore(dispatcher *Dispatcher) *EventStore
NewEventStore initializes an EventStore with a dispatcher and an event pool
func (*EventStore) Broadcast ¶
func (eventstore *EventStore) Broadcast() error
Broadcast locks the store and processes each event in the pool
func (*EventStore) Commit ¶ added in v0.1.11
func (eventstore *EventStore) Commit() error
Commit retrieves and processes an event from the pool
func (*EventStore) Publish ¶
func (eventstore *EventStore) Publish(event *Event)
Publish adds an event to the event pool
type RabbitDispatcher ¶ added in v0.1.25
Dispatcher maps string representations of projections to handler functions
type RabbitEventStore ¶ added in v0.1.25
type RabbitEventStore struct {
Mutex sync.Mutex
Dispatcher *RabbitDispatcher
RabbitConn *amqp.Connection
RabbitChannel *amqp.Channel
QueueName string
}
RabbitEventStore handles publishing and dispatching events via RabbitMQ
func NewRabbitEventStore ¶ added in v0.1.25
func NewRabbitEventStore(dispatcher *RabbitDispatcher, rabbitURL, queueName string) (*RabbitEventStore, error)
NewRabbitEventStore initializes a RabbitEventStore
func (*RabbitEventStore) Broadcast ¶ added in v0.1.25
func (store *RabbitEventStore) Broadcast(ctx context.Context)
Broadcast starts consuming events from RabbitMQ
func (*RabbitEventStore) Commit ¶ added in v0.1.25
func (store *RabbitEventStore) Commit(event *Event) error
Commit processes a single event
func (*RabbitEventStore) Publish ¶ added in v0.1.25
func (store *RabbitEventStore) Publish(event *Event)
Publish sends an event to the RabbitMQ queue