Documentation
¶
Index ¶
- type Publisher
- func (pub *Publisher) AutoPublishStarted() bool
- func (pub *Publisher) FlushStops()
- func (pub *Publisher) Notifications() <-chan *models.Notification
- func (pub *Publisher) Publish(letter *models.Letter)
- func (pub *Publisher) PublishWithRetry(letter *models.Letter)
- func (pub *Publisher) QueueLetter(letter *models.Letter)
- func (pub *Publisher) QueueLetters(letters []*models.Letter)
- func (pub *Publisher) Shutdown(shutdownPools bool)
- func (pub *Publisher) StartAutoPublish(allowRetry bool)
- func (pub *Publisher) StopAutoPublish()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Publisher ¶
type Publisher struct { Config *models.RabbitSeasoning ChannelPool *pools.ChannelPool // contains filtered or unexported fields }
Publisher contains everything you need to publish a message.
func NewPublisher ¶
func NewPublisher( config *models.RabbitSeasoning, chanPool *pools.ChannelPool, connPool *pools.ConnectionPool) (*Publisher, error)
NewPublisher creates and configures a new Publisher.
func (*Publisher) AutoPublishStarted ¶
AutoPublishStarted allows you to see if the AutoPublish feature has started - is locking.
func (*Publisher) FlushStops ¶
func (pub *Publisher) FlushStops()
FlushStops flushes out all the AutoStop messages.
func (*Publisher) Notifications ¶
func (pub *Publisher) Notifications() <-chan *models.Notification
Notifications yields all the success and failures during all publish events. Highly recommend susbscribing to this. Buffer will block if not consumed and leave goroutines stuck.
func (*Publisher) Publish ¶
Publish sends a single message to the address on the letter. Subscribe to Notifications to see success and errors.
func (*Publisher) PublishWithRetry ¶
PublishWithRetry sends a single message to the address on the letter with retry capabilities. Subscribe to Notifications to see success and errors. RetryCount is based on the letter property. Zero means it will try once.
func (*Publisher) QueueLetter ¶
QueueLetter queues up a letter that will be consumed by AutoPublish. Blocks on the Letter Buffer being full.
func (*Publisher) QueueLetters ¶ added in v1.1.0
QueueLetters allows you to bulk queue letters that will be consumed by AutoPublish. Blocks on the Letter Buffer being full.
func (*Publisher) Shutdown ¶
Shutdown cleanly shutsdown the publisher and resets it's internal state.
func (*Publisher) StartAutoPublish ¶
StartAutoPublish starts auto-publishing letters queued up - is locking.
func (*Publisher) StopAutoPublish ¶
func (pub *Publisher) StopAutoPublish()
StopAutoPublish stops publishing letters queued up - is locking.