//SdlInstance where namespace can be defined only at SdlInstance instance creation
//time.
type SyncStorage struct {
//SdlInstance where namespace can be defined only at SdlInstance instance creation
//time.
type SyncStorage struct {
//events received from different channels, callbacks are called in series one by one.
func (s *SyncStorage) SubscribeChannel(ns string, cb func(string, ...string), channels ...string) error {
nsPrefix := getNsPrefix(ns)
//events received from different channels, callbacks are called in series one by one.
func (s *SyncStorage) SubscribeChannel(ns string, cb func(string, ...string), channels ...string) error {
nsPrefix := getNsPrefix(ns)
- s.getDbBackend(ns).SubscribeChannelDB(cb, nsPrefix, s.eventSeparator, s.setNamespaceToChannels(nsPrefix, channels...)...)
- return nil
+ return s.getDbBackend(ns).SubscribeChannelDB(cb, s.setNamespaceToChannels(nsPrefix, channels...)...)
}
//UnsubscribeChannel removes subscription from one or several channels under given
//namespace.
func (s *SyncStorage) UnsubscribeChannel(ns string, channels ...string) error {
nsPrefix := getNsPrefix(ns)
}
//UnsubscribeChannel removes subscription from one or several channels under given
//namespace.
func (s *SyncStorage) UnsubscribeChannel(ns string, channels ...string) error {
nsPrefix := getNsPrefix(ns)
- if strings.Contains(v, s.eventSeparator) {
- return fmt.Errorf("%s: event %s contains illegal substring (\"%s\")", cmd, v, s.eventSeparator)
+ if strings.Contains(v, sdlgoredis.EventSeparator) {
+ return fmt.Errorf("%s: event %s contains illegal substring (\"%s\")", cmd, v, sdlgoredis.EventSeparator)
- SubscribeChannelDB(cb func(string, ...string), channelPrefix, eventSeparator string, channels ...string)
- UnsubscribeChannelDB(channels ...string)
+ SubscribeChannelDB(cb func(string, ...string), channels ...string) error
+ UnsubscribeChannelDB(channels ...string) error
MSet(pairs ...interface{}) error
MSetMPub(channelsAndEvents []string, pairs ...interface{}) error
MGet(keys []string) ([]interface{}, error)
MSet(pairs ...interface{}) error
MSetMPub(channelsAndEvents []string, pairs ...interface{}) error
MGet(keys []string) ([]interface{}, error)