From 8a4d4f82941f9b8f351fbc75cf304f08297ccba0 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Tue, 11 Apr 2017 20:54:15 -0700 Subject: [PATCH] Add IsClosed method to Melody --- melody.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/melody.go b/melody.go index 00b1928..9b0f710 100644 --- a/melody.go +++ b/melody.go @@ -302,6 +302,11 @@ func (m *Melody) Len() int { return m.hub.len() } +// IsClosed returns the status of the melody instance. +func (m *Melody) IsClosed() bool { + return m.hub.closed() +} + // FormatCloseMessage formats closeCode and text as a WebSocket close message. func FormatCloseMessage(closeCode int, text string) []byte { return websocket.FormatCloseMessage(closeCode, text)