func (b *PubSubBroker) PublishMessage(name, msg string) int64 {
	b.mu.RLock()
	ch, ok := b.channels[name]
	b.mu.RUnlock()

	if ok {
		return ch.Publish(name, msg)
	}
	return 0
}
// PublishMessage allows to publish a message to the broker
// outside the command-cycle. Returns the number of subscribers
PublishMessage allows to publish a message to the broker
outside the command-cycle. Returns the number of subscribers
// PublishMessage allows to publish a message to the broker // outside the command - cycle . Returns the number of subscribers
func (b *PubSubBroker) PublishMessage(name, msg string) int64 {
	b.mu.RLock()
	ch, ok := b.channels[name]
	b.mu.RUnlock()
	if ok {
		return ch.Publish(name, msg)
	}
	return 0
}
func ( b * PubSubBroker ) PublishMessage ( name , msg string ) int64 { b . mu . RLock ( ) ch , ok := b . channels [ name ] b . mu . RUnlock ( ) if ok { return ch . Publish ( name , msg ) } return 0 }
PublishMessage allows to publish a message to the broker
outside the command-cycle.
PublishMessage allows to publish a message to the broker outside the command - cycle .