Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger execution order #4602

Open
mversic opened this issue May 16, 2024 · 2 comments
Open

Trigger execution order #4602

mversic opened this issue May 16, 2024 · 2 comments
Labels
Bug Something isn't working question Further information is requested

Comments

@mversic
Copy link
Contributor

mversic commented May 16, 2024

Maybe this is a non-issue, but we should define what the order of execution of triggers is when multiple triggers are triggered at the end of block. Also, impose ordering when multiple triggers are triggered by the same event

@mversic mversic added Bug Something isn't working question Further information is requested labels May 16, 2024
@Erigara
Copy link
Contributor

Erigara commented May 24, 2024

So currently we have following trigger execution order:

  1. Data events are execute trigger events are produced depending on block content, and for triggers match order depends on trigger id order.
  2. Time events are emitted last so time triggers executed also based on trigger id ordering.

Let's consider the following:

  1. Data events A, B, C
  2. Execute trigger event E
  3. Time event T
  4. Ordering of the events is the following A, E, B, C, T (T is always last)
  5. There is triggers:
    1. TA1, TA2 which triggers by A
    2. TB by B
    3. TC1 and TC2 by C
    4. TE by E: since execute trigger event contains trigger id only single matching trigger is possible
    5. TT1 have 1 match for T, TT2 have 2 matches for T, TT3 have 3 matches for T
  6. There is ordering of trigger ids: TA1 < TA2, TC1 < TC2, TT1 < TT2 < TT3

Then the following execution queue will be created: TA1, TA2, TE, TB, TC1, TC2, TT1, TT2, TT2, TT3, TT3, TT3.

@Erigara
Copy link
Contributor

Erigara commented May 27, 2024

@mversic is that should be documented somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants