Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventService ¶
type EventService interface { GetPublisher() Publisher GetSubscriber() Subscriber }
type EventSystem ¶
type EventSystem interface { Subscriber Publisher }
type Publisher ¶
type Publisher interface {
Publish(event Event)
}
func GetPublisher ¶
func GetPublisher(sp view.ServiceProvider) (Publisher, error)
type Service ¶
type Service struct {
EventSystem EventSystem
}
func (*Service) GetPublisher ¶
func (*Service) GetSubscriber ¶
func (s *Service) GetSubscriber() Subscriber
type Subscriber ¶
type Subscriber interface { Subscribe(topic string, receiver Listener) Unsubscribe(topic string, receiver Listener) }
func GetSubscriber ¶
func GetSubscriber(sp view.ServiceProvider) (Subscriber, error)
type Subscribers ¶
type Subscribers struct {
// contains filtered or unexported fields
}
Subscribers is a thread-safe map of subscribers. It is used to keep track of bindings between wrapped listeners and their wrappers.
func NewSubscribers ¶
func NewSubscribers() *Subscribers
NewSubscribers returns a new instance of Subscribers.
func (*Subscribers) Delete ¶
func (s *Subscribers) Delete(id string, wrapped interface{})
Delete removes the binding for the given id and wrapped listener
func (*Subscribers) Get ¶
func (s *Subscribers) Get(id string, wrapped interface{}) (interface{}, bool)
Get returns the wrapper listener for the given id and wrapped listener.
func (*Subscribers) Set ¶
func (s *Subscribers) Set(id string, wrapped, wrapper interface{})
Set sets a new binding between a wrapped listener and its wrapper. The binding is indexed by the passed id.
Click to show internal directories.
Click to hide internal directories.