Difference between revisions of "Actions"
(Explain synchronous and asynchronous actions) Tags: Mobile web edit Mobile edit |
|||
Line 2: | Line 2: | ||
=== Synchronous vs asynchronous === | === Synchronous vs asynchronous === | ||
− | Most of MacroDroid actions take a minuscule amount of time to execute. But some actions such as HTTP request or a shell script action can take | + | Most of MacroDroid actions take a minuscule amount of time to execute. But some actions such as HTTP request or a shell script action can take a significant time to complete. Some of these actions have an option to "Block next action until complete" in their configuration GUI. If this option is enabled subsequent actions will wait until this action completes before continuing. If the option is disabled the action will run asynchronously while other actions continue. |
In conventional programming languages you would probably be able to pass a callback to call when the execution is complete to perform some other actions after the asynchronous action has completed (possibly even work with the data if the asynchronous action returned some), but because MacroDroid inner workings are rather arbitrary there is usually no such systematic option and you need to rely on different workarounds. | In conventional programming languages you would probably be able to pass a callback to call when the execution is complete to perform some other actions after the asynchronous action has completed (possibly even work with the data if the asynchronous action returned some), but because MacroDroid inner workings are rather arbitrary there is usually no such systematic option and you need to rely on different workarounds. |
Revision as of 13:26, 5 January 2024
An action is something your device can do when a macro runs. A macro must have at least one action to be valid.
Synchronous vs asynchronous
Most of MacroDroid actions take a minuscule amount of time to execute. But some actions such as HTTP request or a shell script action can take a significant time to complete. Some of these actions have an option to "Block next action until complete" in their configuration GUI. If this option is enabled subsequent actions will wait until this action completes before continuing. If the option is disabled the action will run asynchronously while other actions continue.
In conventional programming languages you would probably be able to pass a callback to call when the execution is complete to perform some other actions after the asynchronous action has completed (possibly even work with the data if the asynchronous action returned some), but because MacroDroid inner workings are rather arbitrary there is usually no such systematic option and you need to rely on different workarounds.
List of Actions
Notification LED Enable/Disable
Priority Mode / Do Not Disturb