diff --git a/handler.go b/handler.go index d8668dd..0a13421 100644 --- a/handler.go +++ b/handler.go @@ -2,9 +2,10 @@ package gosocketio import ( "encoding/json" - "forge.cadoles.com/Pyxis/golang-socketio/protocol" - "sync" "reflect" + "sync" + + "forge.cadoles.com/Pyxis/golang-socketio/protocol" ) const ( @@ -52,6 +53,15 @@ func (m *methods) On(method string, f interface{}) error { return nil } +/** +Remove message processing function +*/ +func (m *methods) Off(method string) { + m.messageHandlersLock.Lock() + defer m.messageHandlersLock.Unlock() + delete(m.messageHandlers, method) +} + /** Find message processing function associated with given method */