Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDeleteAfterPublish ¶
func WithDeleteAfterPublish() func(*publisherOption)
WithDeleteAfterPublish specifies that a published event from the outbox will be deleted instead of marked as published as it is not interesting to have the event as a timelog history.
func WithLoopingInterval ¶
WithLoopingInterval specifies the interval on which the loop to check the pending to publish events is executed
func WithNoficationChannel ¶
func WithNoficationChannel(notificationCh chan<- bunnify.Notification) func(*publisherOption)
WithNoficationChannel specifies a go channel to receive messages such as connection established, reconnecting, event published, consumed, etc.
Types ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher is used for publishing events.
func NewPublisher ¶
func NewPublisher( ctx context.Context, db *pgxpool.Pool, inner bunnify.Publisher, opts ...func(*publisherOption)) (*Publisher, error)
NewPublisher creates a publisher using a database connection and acts as a wrapper for bunnify publisher.
func (*Publisher) Publish ¶
func (p *Publisher) Publish( ctx context.Context, tx pgx.Tx, exchange string, routingKey string, event bunnify.PublishableEvent) error
Publish publishes an event to the outbox database table. Then the loop will pick this up and try to use the inner bunnify Publisher do an AQMP publish.