raven-go
raven-go copied to clipboard
Wait all message sent when close client
Maybe we could make Client.Close likes:
func (client *Client) Close() {
close(client.queue)
waitCh := make(chan struct{})
go func() {
client.wg.Wait()
waitCh <- struct{}{}
}()
select {
case <-time.NewTimer(SEND_TIMEOUT):
case <-waitCh:
}
}
That would be helpful if we want to send all errors in the signal handler.