Skip to content

Commit

Permalink
update: register subscriber to multiple topics
Browse files Browse the repository at this point in the history
  • Loading branch information
sreeram77 committed Apr 15, 2023
1 parent 0a01dd3 commit 5cb4119
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ func New(r storage.Cache) Manager {
}
}

func (em *eventManager) RegisterSubscriber(topic string, eventChan chan event.Event) error {
log.Info("Registering subscriber for topic:", topic)
func (em *eventManager) RegisterSubscriber(topics []string, eventChan chan event.Event) error {
log.Info("Registering subscriber for topic:", topics)

em.connections.Set(topic, eventChan)
for _, topic := range topics {
em.connections.Set(topic, eventChan)
}

return nil
}
Expand Down

0 comments on commit 5cb4119

Please sign in to comment.