Skip to content

Commit

Permalink
add sub recv timeout support
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincarper authored and gdamore committed Jul 30, 2019
1 parent 012b6c6 commit 12bbb93
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions protocol/sub/sub.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,15 @@ func (c *context) SetOption(name string, value interface{}) error {
}
return protocol.ErrBadValue

case protocol.OptionRecvDeadline:
if v, ok := value.(time.Duration); ok {
c.s.Lock()
c.recvExpire = v
c.s.Unlock()
return nil
}
return protocol.ErrBadValue

case protocol.OptionSubscribe:
case protocol.OptionUnsubscribe:
default:
Expand Down

0 comments on commit 12bbb93

Please sign in to comment.