From 5b85eed646ca118aa3d61437f2a9904e1a9eeac3 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sat, 17 Oct 2020 13:03:49 +0200 Subject: [PATCH] Add Count method to stream --- stream/messaging.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stream/messaging.go b/stream/messaging.go index 05d55ad..a53c427 100644 --- a/stream/messaging.go +++ b/stream/messaging.go @@ -75,3 +75,8 @@ func (s *Stream) Unregister(output chan []byte) { close(output) } } + +// Count number of outputs +func (s *Stream) Count() int { + return len(s.outputs) +}