utils

package
v0.0.0-...-cdb609d Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentPub       = "pub"
	ComponentSub       = "sub"
	ComponentRoom      = "room"
	ComponentAPI       = "api"
	ComponentTransport = "transport"
	ComponentSFU       = "sfu"
	// transport subcomponents
	ComponentCongestionControl = "cc"
)

Variables

This section is empty.

Functions

func ClientInfoWithoutAddress

func ClientInfoWithoutAddress(c *livekit.ClientInfo) *livekit.ClientInfo

func ContextWithAttempt

func ContextWithAttempt(ctx context.Context, attempt int) context.Context

func ContextWithLogger

func ContextWithLogger(ctx context.Context, logger logger.Logger) context.Context

func GetAttempt

func GetAttempt(ctx context.Context) int

func GetLogger

func GetLogger(ctx context.Context) logger.Logger

func MedianFloat32

func MedianFloat32(input []float32) float32

MedianFloat32 gets median value for an array of float32

Types

type ChangeNotifier

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

func NewChangeNotifier

func NewChangeNotifier() *ChangeNotifier

func (*ChangeNotifier) AddObserver

func (n *ChangeNotifier) AddObserver(key string, onChanged func())

func (*ChangeNotifier) HasObservers

func (n *ChangeNotifier) HasObservers() bool

func (*ChangeNotifier) NotifyChanged

func (n *ChangeNotifier) NotifyChanged()

func (*ChangeNotifier) RemoveObserver

func (n *ChangeNotifier) RemoveObserver(key string)

type ChangeNotifierManager

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

func NewChangeNotifierManager

func NewChangeNotifierManager() *ChangeNotifierManager

func (*ChangeNotifierManager) GetNotifier

func (m *ChangeNotifierManager) GetNotifier(key string) *ChangeNotifier

func (*ChangeNotifierManager) GetOrCreateNotifier

func (m *ChangeNotifierManager) GetOrCreateNotifier(key string) *ChangeNotifier

func (*ChangeNotifierManager) RemoveNotifier

func (m *ChangeNotifierManager) RemoveNotifier(key string, force bool)

type IncrementalDispatcher

type IncrementalDispatcher[T any] struct {
	// contains filtered or unexported fields
}

IncrementalDispatcher is a dispatcher that allows multiple consumers to consume items as they become available, while producers can add items at anytime.

func NewIncrementalDispatcher

func NewIncrementalDispatcher[T any]() *IncrementalDispatcher[T]

func (*IncrementalDispatcher[T]) Add

func (d *IncrementalDispatcher[T]) Add(item T)

func (*IncrementalDispatcher[T]) Done

func (d *IncrementalDispatcher[T]) Done()

func (*IncrementalDispatcher[T]) ForEach

func (d *IncrementalDispatcher[T]) ForEach(fn func(T))

type OpsQueue

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

func NewOpsQueue

func NewOpsQueue(params OpsQueueParams) *OpsQueue

func (*OpsQueue) Enqueue

func (oq *OpsQueue) Enqueue(op func())

func (*OpsQueue) Start

func (oq *OpsQueue) Start()

func (*OpsQueue) Stop

func (oq *OpsQueue) Stop() <-chan struct{}

type OpsQueueParams

type OpsQueueParams struct {
	Name        string
	MinSize     uint
	FlushOnStop bool
	Logger      logger.Logger
}

Jump to

Keyboard shortcuts

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