Remove Probe() method
This commit is contained in:
parent
a2d1c675d7
commit
505d462352
|
@ -1,37 +0,0 @@
|
|||
package reach
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"forge.cadoles.com/Pyxis/golang-socketio"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
// EventProbe -
|
||||
EventProbe = "probe"
|
||||
)
|
||||
|
||||
// Probe -
|
||||
func (c *Client) Probe() error {
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
||||
wg.Add(1)
|
||||
|
||||
c.conn.On(EventProbe, func(h *gosocketio.Channel) {
|
||||
wg.Done()
|
||||
c.conn.On(EventProbe, nil)
|
||||
})
|
||||
|
||||
c.logf("sending '%s' event", EventProbe)
|
||||
if err := c.conn.Emit(EventProbe, nil); err != nil {
|
||||
return errors.Wrapf(err, "error while emitting '%s' event", EventProbe)
|
||||
}
|
||||
c.logf("'%s' event sent", EventProbe)
|
||||
|
||||
wg.Wait()
|
||||
|
||||
return nil
|
||||
|
||||
}
|
Reference in New Issue