Beispiel #1
0
func (s *Service) registerAdditional(bus *pubsub.PubSub, topic string, handler MailboxHandler, mb chan *pubsub.Mailbox) {
	bus.AddSub(mb, topic)
	s.registry[topic] = handler
}
Beispiel #2
0
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")
}
Beispiel #3
0
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
}