eventstream

package
v0.0.0-...-27ca59a Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

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