The DL_OnSend() event procedure is only entered after the current line of script code has been executed. "Send" requests are buffered in the meantime.
The sequence diagram below shows the resulting timing behavior for an example with one 'manual' send request (sequence1), and a second Send Sequence triggered by script code (DL.SendSequence "sequence2").
Similar to DL_OnSend(), the DL_OnReceive() event procedure is not executed immediately after Docklight has detected a new Receive Sequence match. Instead, the events are buffered and executed after the current line of script code has been executed.
The sequence diagram below shows the timing for an example where two different Receive Sequences are detected in one go, and the DL_OnReceive() code is executed at a later point.