Skip to content

Allowing State Trigger Decorator Function to be Called While Executing Another Function #716

Answered by craigbarratt
jlkermit asked this question in Q&A
Discussion options

You must be logged in to vote

Trigger functions run asynchronously after they are triggered. There's no guarantee that the statements inside one trigger function will be executed before or after another function's statements when triggered at almost the same time. Statements could even be interleaved between functions (actually, the granularity is finer than that: one function could give up control in the middle of evaluating an expression, and execution of the other function could continue next). This means you can suffer from various race conditions if you don't make your code robust to indeterminate relative order of execution.

As you saw, when you change the state variable in one function, it takes a bit of time f…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@jlkermit
Comment options

@IgnusG
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jlkermit
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants