Skip to content

Commit

Permalink
feat(messenger/publisher): make ctx required
Browse files Browse the repository at this point in the history
  • Loading branch information
mgjules committed Apr 11, 2022
1 parent 9fcae99 commit 4716739
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions transport/messenger/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ func NewTestPublisher(logger *logger.Logger) *Publisher {
}

// Publish is a wrapper for the MessagePublishr.Publish.
func (p *Publisher) Publish(topic string, message ...*message.Message) error {
return p.MessagePublisher().Publish(topic, message...)
func (p *Publisher) Publish(ctx context.Context, topic string, messages ...*message.Message) error {
for _, m := range messages {
m.SetContext(ctx)
}

return p.MessagePublisher().Publish(topic, messages...)
}

// MessagePublisher returns the message publisher.
Expand Down

0 comments on commit 4716739

Please sign in to comment.