sentry-go icon indicating copy to clipboard operation
sentry-go copied to clipboard

Flush to receive go context type

Open sermio-te opened this issue 1 year ago • 1 comments

Summary

Currently Flush function receives a timeout, so when it is called someone needs to provide a timeout value. By using a context of the app and propagating to Flush the operation will timeout whenever the context expires, so no explicit timeout is needed.

Motivation

This solution will remove some corner-case in the blocking operations of an application. If a long timeout is specified the application might wait for long. If the application already performs some finalisation and has an overall shutdown timeout, we would need to calculate the duration left to timeout, in order to provide to Flush.

Additional Context

sermio-te avatar Nov 17 '23 00:11 sermio-te

This is definitely more in the spirit of Go, but we also need to respect the unified API for consistency across the various language SDKs.

Perhaps we could add a more Go specific Flush in addition to the common API?

greywolve avatar Nov 17 '23 02:11 greywolve