Questions about the order in which various events occur in a software system. For example, the order in which queued asynchronous tasks are executed in JavaScript or the order in which triggers are called and constraints are checked in SQL. Distinct from [operator-precedence], which covers the order in which operators are applied when evaluating an expression in a programming language.
Many software systems provide for the automatic and/or event driven execution of software in response to some event or in some other way in which it may not be obvious in which order the various pieces are executed, or if there even is a defined order. This tag is for questions about the rules or behavior of those kinds of systems. It is distinct from operator-precedence, which covers the order in which operators are applied when evaluating an expression in a programming language.
Examples of order-of-execution questions include:
- In JavaScript, if there are multiple event handlers handling the same event, in which order are they called?
- In SQL, are triggers called before or after constraints are applied?
- In Rails ActiveRecord, if multiple callbacks are registered on the same event, e.g.
before_create
, in which order will they be called? - In JavaScript, what is the difference between a "task" and a "microtask" and when are they executed?