Handlers for splunk/cw could be improved with this:
var result bool
sl.closeOnce.Do(func() {
if !sl.active.Load() {
return
}
close(sl.payloads)
for {
select {
case <-time.After(10 * time.Millisecond):
if !sl.active.Load() {
result = true
return
}
case <-time.After(timeout):
result = false
return
}
}
})
As it was suggested here: #31 (comment)
Handlers for splunk/cw could be improved with this:
As it was suggested here: #31 (comment)