func (ps *PubSub) Publish(a *types.Action, subs ...string) error {
	ps.subLock.RLock()
	defer ps.subLock.RUnlock()

	for _, sub := range subs {
		subCh, ok := ps.subChs[sub]
		if !ok {
			continue
		}
		subCh <- a
	}

	return nil
}
// Publishes the given command to all clients subscribed to the given
// subscriptions
Publishes the given command to all clients subscribed to the given
subscriptions
// Publishes the given command to all clients subscribed to the given // subscriptions
func (ps *PubSub) Publish(a *types.Action, subs ...string) error {
	ps.subLock.RLock()
	defer ps.subLock.RUnlock()
	for _, sub := range subs {
		subCh, ok := ps.subChs[sub]
		if !ok {
			continue
		}
		subCh <- a
	}
	return nil
}
func ( ps * PubSub ) Publish ( a * types . Action , subs ... string ) error { ps . subLock . RLock ( ) defer ps . subLock . RUnlock ( ) for _ , sub := range subs { subCh , ok := ps . subChs [ sub ] if ! ok { continue } subCh <- a } return nil }
Publishes the given command to all clients subscribed to the given
subscriptions
Publishes the given command to all clients subscribed to the given subscriptions