Add msgq.(*Queue).Close for orderly shutdown

pull/1710/head
Eugene Kim 5 years ago
parent 98a7adfa84
commit 2b95dd8fbd
  1. 6
      msgq/msgq.go

@ -47,5 +47,11 @@ func (q *Queue) HandleMessages(h MessageHandler) {
}
}
// Close closes the given queue.
func (q *Queue) Close() error {
close(q.ch)
return nil
}
// ErrRxOverrun signals that a receive queue has been overrun.
var ErrRxOverrun = errors.New("rx overrun")

Loading…
Cancel
Save