func (s *sub) Close() error {
	go func() {
		s.Lock()
		defer s.Unlock()

		if s.hub == nil {
			return
		}

		s.hub.remove(s)
		s.hub = nil
		s.closed <- true

		s.conn.Unsubscribe(s.channels...)

		// TODO safe stop of start goroutine
		s.conn.Close()

		close(s.send)
	}()
	return nil
}
func (s *sub) Close() error {
	go func() {
		s.Lock()
		defer s.Unlock()

		if s.hub == nil {
			return
		}

		s.hub.remove(s)
		s.hub = nil
		s.closed <- true

		s.conn.Unsubscribe(s.channels...)

		
		s.conn.Close()

		close(s.send)
	}()
	return nil
}
func ( s * sub ) Close ( ) error { go func ( ) { s . Lock ( ) defer s . Unlock ( ) if s . hub == nil { return } s . hub . remove ( s ) s . hub = nil s . closed <- true s . conn . Unsubscribe ( s . channels ... ) // TODO safe stop of start goroutine s . conn . Close ( ) close ( s . send ) } ( ) return nil }
// Close removes subscriber from channel.
Close removes subscriber from channel .