Always Trigger.signal after transfer/release has completed. This just makes sense.
Capture stack trace in handlers explicitly before calling user given code. This has the downside that capturing a stack trace allocates, which is both expensive and, I assume, also allows an asynchronous exception. OTOH, in most cases it is likely better to ensure stack traces are captured properly.
Establish handler before call ofTrigger.signal. As specified in the documentation, Trigger.signal should not raise, but it is perhaps better not to trust this.
Changes:
Always
Trigger.signal
after transfer/release has completed. This just makes sense.Capture stack trace in handlers explicitly before calling user given code. This has the downside that capturing a stack trace allocates, which is both expensive and, I assume, also allows an asynchronous exception. OTOH, in most cases it is likely better to ensure stack traces are captured properly.
Establish handler before call of
Trigger.signal
. As specified in the documentation,Trigger.signal
should not raise, but it is perhaps better not to trust this.