subscriber

package
v0.0.0-...-c4caace Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subscriber

type Subscriber struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Subscriber allows processes to subscribe to entity events generated from a tagger.

func NewSubscriber

func NewSubscriber() *Subscriber

NewSubscriber returns a new subscriber.

func (*Subscriber) Notify

func (s *Subscriber) Notify(events []types.EntityEvent)

Notify sends a slice of EntityEvents to all registered subscribers at their chosen cardinality.

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(cardinality collectors.TagCardinality, events []types.EntityEvent) chan []types.EntityEvent

Subscribe returns a channel that receives a slice of events whenever an entity is added, modified or deleted. It can send an initial burst of events only to the new subscriber, without notifying all of the others.

func (*Subscriber) Unsubscribe

func (s *Subscriber) Unsubscribe(ch chan []types.EntityEvent)

Unsubscribe ends a subscription to entity events and closes its channel.

Jump to

Keyboard shortcuts

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