rollbar-go
rollbar-go copied to clipboard
client/transport.Close() does not support context
The close operation for client (and transport as well) should take context argument to make it possible to interrupt the method if it takes to long to send/close everything.
The API is the standard library's Closer
interface. Are you hoping for a separate interface entirely?
Just a dedicated method like Close(ctx context.Context) would do the job. The problem is that your Close
operation is a blocking one and can block graceful shutdown for undefined amount of time. In order to handle that case I have to run it in a separate goroutine leaving it behind when it takes to long to finish.
@swojtasiak , can you check this PR https://github.com/rollbar/rollbar-go/pull/99 and let me know if this is what you want? Also I can add some public context setters. thx!
@swojtasiak Does that PR meet the expectations you had in mind?