Documentation ¶
Index ¶
- type Events
- func (e *Events) Evict(l chan interface{})
- func (e *Events) Log(action eventtypes.Action, eventType eventtypes.Type, actor eventtypes.Actor)
- func (e *Events) PublishMessage(jm eventtypes.Message)
- func (e *Events) Subscribe() ([]eventtypes.Message, chan interface{}, func())
- func (e *Events) SubscribeTopic(since, until time.Time, ef *Filter) ([]eventtypes.Message, chan interface{})
- func (e *Events) SubscribersCount() int
- type Filter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events is pubsub channel for events generated by the engine.
func (*Events) Log ¶
func (e *Events) Log(action eventtypes.Action, eventType eventtypes.Type, actor eventtypes.Actor)
Log creates a local scope message and publishes it
func (*Events) PublishMessage ¶
func (e *Events) PublishMessage(jm eventtypes.Message)
PublishMessage broadcasts event to listeners. Each listener has 100 milliseconds to receive the event or it will be skipped.
func (*Events) Subscribe ¶
func (e *Events) Subscribe() ([]eventtypes.Message, chan interface{}, func())
Subscribe adds new listener to events, returns slice of 256 stored last events, a channel in which you can expect new events (in form of interface{}, so you need type assertion), and a function to call to stop the stream of events.
func (*Events) SubscribeTopic ¶ added in v1.10.0
func (e *Events) SubscribeTopic(since, until time.Time, ef *Filter) ([]eventtypes.Message, chan interface{})
SubscribeTopic adds new listener to events, returns slice of 256 stored last events, a channel in which you can expect new events (in form of interface{}, so you need type assertion).
func (*Events) SubscribersCount ¶
SubscribersCount returns number of event listeners