Add IsAlive() method on client
This commit is contained in:
parent
420c3164d6
commit
e3cc7ab2b1
|
@ -78,6 +78,14 @@ func (c *Client) Close() {
|
||||||
c.conn = nil
|
c.conn = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Client) IsAlive() bool {
|
||||||
|
if c.conn == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.conn.IsAlive()
|
||||||
|
}
|
||||||
|
|
||||||
// Emit a new event with the given data
|
// Emit a new event with the given data
|
||||||
func (c *Client) Emit(event string, data interface{}) error {
|
func (c *Client) Emit(event string, data interface{}) error {
|
||||||
// enc := json.NewEncoder(os.Stdout)
|
// enc := json.NewEncoder(os.Stdout)
|
||||||
|
|
Reference in New Issue