Documentation ¶
Overview ¶
Package handler deals with appropriately reacting to all ACS messages as well as maintaining the connection to ACS.
Index ¶
- type EventStream
- func (eventStream *EventStream) Context() context.Context
- func (eventStream *EventStream) StartListening()
- func (eventStream *EventStream) Subscribe(name string, handler eventHandler) error
- func (eventStream *EventStream) Unsubscribe(name string)
- func (eventStream *EventStream) WriteToEventStream(event interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventStream ¶
type EventStream struct {
// contains filtered or unexported fields
}
EventStream waiting for events and notifying the listeners by invoking the handler that listeners registered
func NewEventStream ¶
func NewEventStream(name string, ctx context.Context) *EventStream
func (*EventStream) Context ¶
func (eventStream *EventStream) Context() context.Context
Context returns the context of event stream
func (*EventStream) StartListening ¶
func (eventStream *EventStream) StartListening()
StartListening mark the event stream as open and start listening
func (*EventStream) Subscribe ¶
func (eventStream *EventStream) Subscribe(name string, handler eventHandler) error
Subscribe adds the handler to be called into EventStream
func (*EventStream) Unsubscribe ¶
func (eventStream *EventStream) Unsubscribe(name string)
Unsubscribe deletes the handler from the EventStream
func (*EventStream) WriteToEventStream ¶
func (eventStream *EventStream) WriteToEventStream(event interface{}) error
WriteToEventStream writes event to the event stream
Click to show internal directories.
Click to hide internal directories.