Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventCallback ¶
type EventCallback func(key string, eventsChannel <-chan interface{})
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager is a manager for session channels It allows to subscribe, publish and unsubscribe to/from channels
func New ¶
func New( logger *zap.Logger, eventsCallback EventCallback, ) *SessionManager
New creates a new SessionManager
func (*SessionManager) Pub ¶
func (manager *SessionManager) Pub(key string, value interface{})
Pub publishes a value to a channel key
func (*SessionManager) Sub ¶
func (manager *SessionManager) Sub(key string)
Sub subscribes to a channel key It's fine to call this function multiple times with the same key - only one channel will be created
func (*SessionManager) Unsub ¶
func (manager *SessionManager) Unsub(key string)
Unsub unsubscribes from a channel key It's fine to call this function multiple times with the same key - only if the key still exists, it will be closed.
Click to show internal directories.
Click to hide internal directories.