Handeling websocket disconnect
This commit is contained in:
@ -84,6 +84,19 @@ func (s *SubscriptionsStore) RemoveAll() {
|
||||
s.mutex.Unlock()
|
||||
}
|
||||
|
||||
func (s *SubscriptionsStore) GetAll() []*subscription.Subscription {
|
||||
s.mutex.Lock()
|
||||
subsList := make([]*subscription.Subscription, 0)
|
||||
for i := range s.subs {
|
||||
//close all listeners
|
||||
for j := range s.subs[i] {
|
||||
subsList = append(subsList, s.subs[i][j])
|
||||
}
|
||||
}
|
||||
s.mutex.Unlock()
|
||||
return subsList
|
||||
}
|
||||
|
||||
// Count return the number of subscriptions associated with the specified channel
|
||||
func (s *SubscriptionsStore) Count(channel string) int {
|
||||
return len(s.Match(channel))
|
||||
|
@ -1,7 +1,7 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"github.com/thesyncim/faye/subscription"
|
||||
"gitea.watsonlabs.net/watsonb8/fayec/subscription"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
Reference in New Issue
Block a user