broadcaster

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Log                     messageType = "Log"
	NamespaceCreated        messageType = "NamespaceCreated"
	NamespaceDeleted        messageType = "NamespaceDeleted"
	PipelineCreated         messageType = "PipelineCreated"
	PipelineDeleted         messageType = "PipelineDeleted"
	PipelineUpdated         messageType = "PipelineUpdated"
	ClusterTaskCreated      messageType = "ClusterTaskCreated"
	ClusterTaskDeleted      messageType = "ClusterTaskDeleted"
	ClusterTaskUpdated      messageType = "ClusterTaskUpdated"
	TaskCreated             messageType = "TaskCreated"
	TaskDeleted             messageType = "TaskDeleted"
	TaskUpdated             messageType = "TaskUpdated"
	PipelineResourceCreated messageType = "PipelineResourceCreated"
	PipelineResourceDeleted messageType = "PipelineResourceDeleted"
	PipelineResourceUpdated messageType = "PipelineResourceUpdated"
	PipelineRunCreated      messageType = "PipelineRunCreated"
	PipelineRunDeleted      messageType = "PipelineRunDeleted"
	PipelineRunUpdated      messageType = "PipelineRunUpdated"
	TaskRunCreated          messageType = "TaskRunCreated"
	TaskRunDeleted          messageType = "TaskRunDeleted"
	TaskRunUpdated          messageType = "TaskRunUpdated"
	ExtensionCreated        messageType = "ExtensionCreated"
	ExtensionUpdated        messageType = "ExtensionUpdated"
	ExtensionDeleted        messageType = "ExtensionDeleted"
	SecretCreated           messageType = "SecretCreated"
	SecretDeleted           messageType = "SecretDeleted"
	SecretUpdated           messageType = "SecretUpdated"
)

Reference outside of package

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcaster

type Broadcaster struct {
	// contains filtered or unexported fields
}

Only a pointer to the struct should be used

func NewBroadcaster

func NewBroadcaster(c chan SocketData) *Broadcaster

Creates broadcaster from channel parameter and immediately starts broadcasting Without any subscribers, received data will be discarded Broadcaster should be the only channel reader

func (*Broadcaster) Expired

func (b *Broadcaster) Expired() bool

func (*Broadcaster) PoolSize

func (b *Broadcaster) PoolSize() (size int)

Iterates over sync.Map and returns number of elements Response can be oversized if counted subscriptions are cancelled while counting

func (*Broadcaster) Subscribe

func (b *Broadcaster) Subscribe() (*Subscriber, error)

Subscriber expected to constantly consume or unsubscribe

func (*Broadcaster) Unsubscribe

func (b *Broadcaster) Unsubscribe(sub *Subscriber) error

type SocketData

type SocketData struct {
	MessageType messageType
	Payload     interface{}
}

type Subscriber

type Subscriber struct {
	// contains filtered or unexported fields
}

Wrapper return type for subscriptions

func (*Subscriber) SubChan

func (s *Subscriber) SubChan() <-chan SocketData

Read-Only access to the subscription channel Open or nil, never closed

func (*Subscriber) UnsubChan

func (s *Subscriber) UnsubChan() <-chan struct{}

Closed on unsubscribe or when broadcast parent channel closes

Jump to

Keyboard shortcuts

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