Hi there. Do i need to wrap Sentry.capture_message in Task.async or is it already async by itself? To ensure no slowdown in production
I checked docs but didn’t find the answer.
Hi there. Do i need to wrap Sentry.capture_message in Task.async or is it already async by itself? To ensure no slowdown in production
I checked docs but didn’t find the answer.
TL;DR: You don’t need to wrap it in a Task.async, It does that asynchronously for you by default.
Based on the code base, In Sentry.Client.send_event/2; the default behaviour for the result type is :none which is defined in the function documentation as follows:
:nonesends the event from an unlinked
child process underSentry.TaskSupervisorand will return{:ok, ""}regardless
of the result.
And you can see the in actual do_send_event/3 implementation that it calls Task.Supervisor.start_child to start a Task Supervisor that actually send the request.