-
Notifications
You must be signed in to change notification settings - Fork 0
Sending a delayed signal
You can specify a duration to wait before dispatching an event to the target instance using the at @ symbol:
Off -> my heater @ heating interval
Here, the variable my heater (note that my is NOT a keyword) gets the event after the delay duration (as close to it as the MX can manage). To send a signal at a specific time, you can also use the @ symbol and supply a time value instead of a duration.
On -> the air conditioner @ time to cooldown
In this example, a time value is stored in the time to cooldown variable. To avoid confusion for the readers of your action language, name your times and delays appropriately as in the examples above.
An error results if the scalar value after the @ is not a time or duration based data type. No, you can’t just use Integer!
Use the cancel signal !-> symbol to cancel a delayed signal:
On !-> the air conditioner @ time to cooldown
Copyright 2020, 2021, 2022, 2023, 2025 © Leon Starr under MIT Open Source License
- Why they are problematic
- Instance attribute creation values
- Boolean values
- Special values
- Enumerated values
- Action block
- Statement
- Single line action
- Multiple dependent actions on a single line
- An action spread across multiple lines
- A conditional group of single line actions
- Comments
- Finding instances
- Attribute access
- Creation and deletion
- Subclass migration
- Creating a table from a class
- Creating a table with a definition
- Converting a table into a class
- Set operations on tables
- Set comparisons on tables
- Join
- Rename
- Extend
- Aggregation
- Rank
- Image
- Input values
- Signatures and name doubling
- Output values
- Execution order
- Sequential execution
- Conditional execution
- Signals
- Scrall has no for_each action
- Iteration