events

package
v1.0.0-1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndSetEventCache

func CreateAndSetEventCache()

func CreateAppEventRecord

func CreateAppEventRecord(objectID, reason, message string) (*si.EventRecord, error)

func CreateNodeEventRecord

func CreateNodeEventRecord(objectID, reason, message string) (*si.EventRecord, error)

func CreateQueueEventRecord

func CreateQueueEventRecord(objectID, groupID, reason, message string) (*si.EventRecord, error)

func CreateRequestEventRecord

func CreateRequestEventRecord(objectID, groupID, reason, message string) (*si.EventRecord, error)

Types

type EventCache

type EventCache struct {
	Store EventStore // storing eventChannel

	sync.Mutex
	// contains filtered or unexported fields
}

func GetEventCache

func GetEventCache() *EventCache

func (*EventCache) AddEvent

func (ec *EventCache) AddEvent(event *si.EventRecord)

func (*EventCache) StartService

func (ec *EventCache) StartService()

func (*EventCache) Stop

func (ec *EventCache) Stop()

type EventPublisher

type EventPublisher interface {
	StartService()
	Stop()
}

func CreateShimPublisher

func CreateShimPublisher(store EventStore) EventPublisher

type EventStore

type EventStore interface {
	Store(event *si.EventRecord)
	CollectEvents() []*si.EventRecord
	CountStoredEvents() int
}

The EventStore operates under the following assumptions:

  • for a given ObjectID only one (the latest) event is stored
  • there is a cap for the number of events stored
  • the CollectEvents() function clears the currently stored events in the EventStore

Assuming the rate of events generated by the scheduler component in a given time period is high, calling CollectEvents() periodically should be fine. Objects are stored using their ObjectID, so different types of objects with the same id overwrite each other.

Jump to

Keyboard shortcuts

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