eventstream

package
v1.40.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package handler deals with appropriately reacting to all ACS messages as well as maintaining the connection to ACS.

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL