From 5e1eaa73edc5242e086ac45bc246a143be028939 Mon Sep 17 00:00:00 2001 From: Darko Luketic Date: Sun, 22 Jul 2018 19:51:30 +0200 Subject: [PATCH] added Notifier.Close() --- notifier.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/notifier.go b/notifier.go index ea9e0ba..871bfc8 100644 --- a/notifier.go +++ b/notifier.go @@ -28,14 +28,17 @@ func (n *Notifier) Listen(then func(notification *Notification)) { func (n *Notifier) Notify(collection, type_ string, data []byte) { n.channel <- &Notification{ Collection: collection, - Type: type_, - Data:data, + Type: type_, + Data: data, } } +func (n *Notifier) Close() { + close(n.channel) +} + type Notification struct { Collection string `json:"collection"` Type string `json:"type"` Data []byte `json:"data,omitempty"` } -