options added
This commit is contained in:
parent
8b1bc57cd0
commit
3f0401de1d
5 changed files with 91 additions and 44 deletions
|
|
@ -22,7 +22,7 @@ func (c *Client) handleReconnect(addr string) {
|
|||
select {
|
||||
case <-c.done:
|
||||
return
|
||||
case <-time.After(c.reconnectDelay):
|
||||
case <-time.After(c.opts.reconnectDelay):
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ func (c *Client) handleReInit(conn *amqp.Connection) bool {
|
|||
case <-c.notifyConnClose:
|
||||
c.logger.Println("Connection closed. Reconnecting...")
|
||||
return false
|
||||
case <-time.After(c.reInitDelay):
|
||||
case <-time.After(c.opts.reInitDelay):
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
|
@ -129,7 +129,7 @@ func (c *Client) Push(data []byte) error {
|
|||
select {
|
||||
case <-c.done:
|
||||
return errShutdown
|
||||
case <-time.After(c.resendDelay):
|
||||
case <-time.After(c.opts.resendDelay):
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue