replace chan struct{}.

This commit is contained in:
Miroslav Šedivý 2021-10-04 14:40:20 +02:00
parent 74dbdea78a
commit e45bd7098f
4 changed files with 12 additions and 12 deletions

View File

@ -27,8 +27,8 @@ type ScreencastManagerCtx struct {
image types.Sample
sample chan types.Sample
sampleStop chan interface{}
sampleUpdate chan interface{}
sampleStop chan struct{}
sampleUpdate chan struct{}
enabled bool
started bool
@ -44,8 +44,8 @@ func screencastNew(enabled bool, pipelineStr string) *ScreencastManagerCtx {
manager := &ScreencastManagerCtx{
logger: logger,
pipelineStr: pipelineStr,
sampleStop: make(chan interface{}),
sampleUpdate: make(chan interface{}),
sampleStop: make(chan struct{}),
sampleUpdate: make(chan struct{}),
enabled: enabled,
started: false,
}

View File

@ -26,8 +26,8 @@ type StreamManagerCtx struct {
pipelineStr func() string
sample chan types.Sample
sampleStop chan interface{}
sampleUpdate chan interface{}
sampleStop chan struct{}
sampleUpdate chan struct{}
listeners map[uintptr]*func(sample types.Sample)
listenersMu sync.Mutex
@ -43,8 +43,8 @@ func streamNew(codec codec.RTPCodec, pipelineStr func() string, video_id string)
logger: logger,
codec: codec,
pipelineStr: pipelineStr,
sampleStop: make(chan interface{}),
sampleUpdate: make(chan interface{}),
sampleStop: make(chan struct{}),
sampleUpdate: make(chan struct{}),
listeners: map[uintptr]*func(sample types.Sample){},
}

View File

@ -19,7 +19,7 @@ var mu = sync.Mutex{}
type DesktopManagerCtx struct {
logger zerolog.Logger
wg sync.WaitGroup
shutdown chan interface{}
shutdown chan struct{}
emmiter events.EventEmmiter
config *config.Desktop
}
@ -27,7 +27,7 @@ type DesktopManagerCtx struct {
func New(config *config.Desktop) *DesktopManagerCtx {
return &DesktopManagerCtx{
logger: log.With().Str("module", "desktop").Logger(),
shutdown: make(chan interface{}),
shutdown: make(chan struct{}),
emmiter: events.New(),
config: config,
}

View File

@ -30,7 +30,7 @@ func New(
return &WebSocketManagerCtx{
logger: logger,
shutdown: make(chan interface{}),
shutdown: make(chan struct{}),
sessions: sessions,
desktop: desktop,
handler: handler.New(sessions, desktop, capture, webrtc),
@ -41,7 +41,7 @@ func New(
type WebSocketManagerCtx struct {
logger zerolog.Logger
wg sync.WaitGroup
shutdown chan interface{}
shutdown chan struct{}
sessions types.SessionManager
desktop types.DesktopManager
handler *handler.MessageHandlerCtx