We use an atexit hook to deliver any outstanding sessions when the process exits, but this delivery happens asynchronously and therefore isn't guaranteed to finish
This PR adds an options parameter to deliver_sessions (matching deliver) that allows forcing synchronous delivery and then uses this to send sessions synchronously at exit
Goal
We use an
atexit
hook to deliver any outstanding sessions when the process exits, but this delivery happens asynchronously and therefore isn't guaranteed to finishThis PR adds an
options
parameter todeliver_sessions
(matchingdeliver
) that allows forcing synchronous delivery and then uses this to send sessions synchronously at exit