Support adding streams on the fly

This commit is contained in:
Alexey Khit
2022-08-18 23:53:24 +03:00
parent 6dceed64ed
commit 7c23625a24
5 changed files with 46 additions and 7 deletions

View File

@@ -120,6 +120,20 @@ func (s *Stream) RemoveProducer(prod streamer.Producer) {
panic("not implemented")
}
func (s *Stream) Active() bool {
if len(s.consumers) > 0{
return true
}
for _, prod := range s.producers {
if prod.element != nil {
return true
}
}
return false
}
func (s *Stream) MarshalJSON() ([]byte, error) {
var v []interface{}
for _, prod := range s.producers {