Closed nathany closed 8 years ago
Maybe something like this?
for {
id, device, err := queue.Response()
if err != push.ErrDone {
break
}
}
Or could split out a separate flag for "more", but that's getting to be a lot of return values. May want to return (resp *Response, more bool)
.
Alternatively, I could export the responses channel, but then it wouldn't be automatically using the WaitGroup that it currently is.
for resp := range queue.Responses {
// do something with resp.ID, resp.DeviceToken, resp.Err
}
What sort of signal should exit this loop? (to clean up the goroutine)
Response returns
id string, deviceToken string, err error
. Maybe a special error, likeio.EOF
?