Documentation
¶
Index ¶
- type Dispatcher
- type Event
- type EventStore
- func (eventstore *EventStore) Broadcast() error
- func (eventstore *EventStore) BroadcastWithRabbitMq()
- func (es *EventStore) CloseRabbitMQ()
- func (eventstore *EventStore) Commit() error
- func (eventstore *EventStore) Publish(event *Event)
- func (eventstore *EventStore) PublishToRabbitMQ(event *Event) error
- type Result
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
RabbitMQ *amqp.Connection
Channel *amqp.Channel
}
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 NewEventStoreWithRabbitMq ¶ added in v0.1.13
func NewEventStoreWithRabbitMq(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) BroadcastWithRabbitMq ¶ added in v0.1.13
func (eventstore *EventStore) BroadcastWithRabbitMq()
Broadcast sends all stored events to RabbitMQ
func (*EventStore) CloseRabbitMQ ¶ added in v0.1.13
func (es *EventStore) CloseRabbitMQ()
CloseRabbitMQ cleans up RabbitMQ resources
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
func (*EventStore) PublishToRabbitMQ ¶ added in v0.1.13
func (eventstore *EventStore) PublishToRabbitMQ(event *Event) error
PublishToRabbitMQ sends an event to RabbitMQ
Click to show internal directories.
Click to hide internal directories.