← Recipe: run a delayed action

6. Understand and adapt

luastra/timer · app.handle · about 10 minutes
handle(start-timer) → Timer.start → handle(timer)

The stable timer id is the event target, while value carries the optional bounded payload.

When to use it

Read this after the unmodified recipe works once.

  • Use restart to replace the delay for the same id.
  • Use cancel when the owning screen or state is no longer active.
  • Treat an unexpected late timer event as stale instead of applying it to unrelated state.
  • Keep delays at or below 60,000 ms; use persisted time or a backend scheduler for longer durable work.

Complete inventory

View all pages in Recipe: run a delayed action
← Previous: 5. Check and run