Documentation ¶
Index ¶
- Variables
- func Init()
- type ActorPublisher
- type ActorSubscriber
- type Event
- func (e *Event) Notify(eventtype EventType, value interface{}) (err error)
- func (e *Event) NotifyAll() (errs []error)
- func (e *Event) NotifySubscriber(eventfunc EventFunc, value interface{})
- func (e *Event) Subscribe(eventtype EventType, eventfunc EventFunc) Subscriber
- func (e *Event) UnSubscribe(eventtype EventType, subscriber Subscriber) (err error)
- type EventFunc
- type EventType
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
View Source
var DefEvtHub *eventhub.EventHub
View Source
var DefPublisherPID *actor.PID
Functions ¶
Types ¶
type ActorPublisher ¶
var DefActorPublisher *ActorPublisher
func NewActorPublisher ¶
func NewActorPublisher(publisher *actor.PID, evtHub ...*eventhub.EventHub) *ActorPublisher
func (*ActorPublisher) Publish ¶
func (this *ActorPublisher) Publish(topic string, msg interface{})
func (*ActorPublisher) PublishEvent ¶
func (this *ActorPublisher) PublishEvent(evt *eventhub.Event)
type ActorSubscriber ¶
func NewActorSubscriber ¶
func NewActorSubscriber(subscriber *actor.PID, evtHub ...*eventhub.EventHub) *ActorSubscriber
func (*ActorSubscriber) Subscribe ¶
func (this *ActorSubscriber) Subscribe(topic string)
func (*ActorSubscriber) Unsubscribe ¶
func (this *ActorSubscriber) Unsubscribe(topic string)
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func (*Event) NotifySubscriber ¶
func (*Event) Subscribe ¶
func (e *Event) Subscribe(eventtype EventType, eventfunc EventFunc) Subscriber
adds a new subscriber to Event.
func (*Event) UnSubscribe ¶
func (e *Event) UnSubscribe(eventtype EventType, subscriber Subscriber) (err error)
UnSubscribe removes the specified subscriber
type Subscriber ¶
type Subscriber chan interface{}
Click to show internal directories.
Click to hide internal directories.