func (s *Service) registerAdditional(bus *pubsub.PubSub, topic string, handler MailboxHandler, mb chan *pubsub.Mailbox) { bus.AddSub(mb, topic) s.registry[topic] = handler }
func Notify(bus *pubsub.PubSub, topic, text string) { mlog.Info(text) payload := &dto.Packet{Topic: topic, Payload: text} // payload := &dto.Packet{Topic: topic, Payload: text} bus.Pub(&pubsub.Message{Payload: payload}, "socket:connections:broadcast") }
func (s *Service) register(bus *pubsub.PubSub, topic string, handler MailboxHandler) (mbox chan *pubsub.Mailbox) { mbox = bus.Sub(topic) s.registry[topic] = handler return mbox }