channel

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeepAliveDuration = 2 * time.Second
	KeepAliveTimeout  = KeepAliveDuration * 3
)

Variables

This section is empty.

Functions

func InitLogger

func InitLogger(gl *logrus.Logger)

Types

type Channel

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

Channel is a bidirectional channel that communicates with each signalling server (by grpc streaming) the goal is to provide mechanism enabling media server to send async event to other servers and route incoming async events to subsystem in media server

func GetSystemChannel

func GetSystemChannel() *Channel

func New

func New() *Channel

func (*Channel) AddListener

func (sc *Channel) AddListener(l Listener)

func (*Channel) BroadcastInstance

func (sc *Channel) BroadcastInstance(se *rpc.SystemEvent) (err error)

BroadcastInstance NONBLOCK send event to all instances

func (*Channel) HasInstance

func (sc *Channel) HasInstance(name string) (exist bool)

func (*Channel) NotifyInstance

func (sc *Channel) NotifyInstance(se *rpc.SystemEvent) (err error)

NotifyInstance NONBLOCK send event to instance

func (*Channel) RegisterInstance

func (sc *Channel) RegisterInstance(name string) (is *InstanceState, err error)

type InstanceState

type InstanceState struct {
	FromInstanceC, ToInstanceC chan *rpc.SystemEvent
	// contains filtered or unexported fields
}

type Listener

type Listener interface {
	// OnChannelEvent invoked by multiple goroutine concurrently
	OnChannelEvent(e *rpc.SystemEvent)
}

Jump to

Keyboard shortcuts

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