(archetype *baseservice.Archetype, listener riverdriver.Listener)
| 96 | } |
| 97 | |
| 98 | func New(archetype *baseservice.Archetype, listener riverdriver.Listener) *Notifier { |
| 99 | notifier := baseservice.Init(archetype, &Notifier{ |
| 100 | listener: listener, |
| 101 | notificationBuf: make(chan *riverdriver.Notification, 1000), |
| 102 | waitInterruptChan: make(chan func(), 10), |
| 103 | |
| 104 | subscriptions: make(map[NotificationTopic][]*Subscription), |
| 105 | }) |
| 106 | return notifier |
| 107 | } |
| 108 | |
| 109 | func (n *Notifier) Start(ctx context.Context) error { |
| 110 | ctx, shouldStart, started, stopped := n.StartInit(ctx) |