Skip to content

Commit

Permalink
Merge branch 'master' into claudio/type-check-loop-bound
Browse files Browse the repository at this point in the history
  • Loading branch information
crusso authored Dec 4, 2024
2 parents f17148f + eb3cbd3 commit 8b60e72
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions doc/md/base/Timer.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
# Timer
Timers for one-off or periodic tasks.

Timers for one-off or periodic tasks. Applicable as part of the default mechanism.

Note: If `moc` is invoked with `-no-timer`, the importing will fail.

Note: The resolution of the timers is in the order of the block rate,
so durations should be chosen well above that. For frequent
canister wake-ups the heatbeat mechanism should be considered.
canister wake-ups the heartbeat mechanism should be considered.

Note: The functionality described below is enabled only when the actor does not override it by declaring an explicit `system func timer`.

Note: Timers are _not_ persisted across upgrades. One possible strategy
to re-establish timers after an upgrade is to walk stable variables
in the `post_upgrade` hook and distill necessary timer information
from there.

Note: Basing security (e.g. access control) on timers is almost always
the wrong choice. Be sure to inform yourself about state-of-the art
dApp security. If you _must use_ timers for security controls, be sure
to consider reentrancy issues, and the vanishing of timers on upgrades
and reinstalls.

Note: For further usage information for timers on the IC please consult
https://internetcomputer.org/docs/current/developer-docs/backend/periodic-tasks#timers-library-limitations

## Type `Duration`
``` motoko no-repl
Expand Down

0 comments on commit 8b60e72

Please sign in to comment.