Difference between revisions of "Execution Method"
(Created page with "Statements are normally executed one after another. Each statement ''waits'' on the previous statement to complete, before it starts to execute. If the previous statement incl...") |
|||
Line 1: | Line 1: | ||
+ | |||
+ | =Sychronous= | ||
+ | |||
Statements are normally executed one after another. Each statement ''waits'' on the previous statement to complete, before it starts to execute. If the previous statement includes a ''Wait'' task, all the remaining tasks in the previous statement, and any statement after that, will be delayed. This is known as ''synchronous'', because everything happens in ''sync'', or, in other words, always happening in the same order. Synchronous execution is the default execution of most statements. | Statements are normally executed one after another. Each statement ''waits'' on the previous statement to complete, before it starts to execute. If the previous statement includes a ''Wait'' task, all the remaining tasks in the previous statement, and any statement after that, will be delayed. This is known as ''synchronous'', because everything happens in ''sync'', or, in other words, always happening in the same order. Synchronous execution is the default execution of most statements. | ||
{{warning|The ''every'' statement, also known as a ''timer'', is an exception to the default rule, because, due to its nature, it always runs asynchronously - see below for more details}} | {{warning|The ''every'' statement, also known as a ''timer'', is an exception to the default rule, because, due to its nature, it always runs asynchronously - see below for more details}} | ||
− | Asynchronous | + | =Asynchronous= |
+ | |||
+ | In contrast, this allows multiple statements to run ''out of sync''. An asynchronous statement can start a wait period that would delay all the remaining tasks, but the next statements will start executing immediately, without waiting for the asynchronous statement to finish. This means that things can now happen out of order, or ''out of sync''. | ||
//todo: examples | //todo: examples |
Revision as of 01:59, 2 October 2017
Sychronous
Statements are normally executed one after another. Each statement waits on the previous statement to complete, before it starts to execute. If the previous statement includes a Wait task, all the remaining tasks in the previous statement, and any statement after that, will be delayed. This is known as synchronous, because everything happens in sync, or, in other words, always happening in the same order. Synchronous execution is the default execution of most statements.
Warning: | The every statement, also known as a timer, is an exception to the default rule, because, due to its nature, it always runs asynchronously - see below for more details |
Asynchronous
In contrast, this allows multiple statements to run out of sync. An asynchronous statement can start a wait period that would delay all the remaining tasks, but the next statements will start executing immediately, without waiting for the asynchronous statement to finish. This means that things can now happen out of order, or out of sync.
//todo: examples