Skip to content

Commit

Permalink
chore: rebuild base docs (#4872)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreif authored Jan 29, 2025
1 parent 9a9cb3c commit e8bd4a7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion doc/md/base/Debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Prints `text` to output stream.

NOTE: When running on an ICP network, all output is written to the [canister log](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/logs) with the exclusion of any output
produced during the execution of non-replicated queries and composite queries.
In other environments, like the interpreter and stand-alone wasm engines, the output is written to standard out.
In other environments, like the interpreter and stand-alone wasm engines, the output is written to standard out.

```motoko include=import
Debug.print "Hello New World!";
Expand Down
2 changes: 2 additions & 0 deletions doc/md/base/Error.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ type ErrorCode = {
#system_fatal;
// Transient error.
#system_transient;
// Response unknown due to missed deadline.
#system_unknown;
// Destination invalid.
#destination_invalid;
// Explicit reject by canister code.
Expand Down
1 change: 0 additions & 1 deletion doc/md/base/ExperimentalInternetComputer.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,3 @@ func replyDeadline() : Nat
Returns the time (in nanoseconds from the epoch start) by when the update message should
reply to the best effort message so that it can be received by the requesting canister.
Queries and non-best-effort update messages return zero.

38 changes: 18 additions & 20 deletions doc/md/base/Timer.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
# Timer

Timers for one-off or periodic tasks. Applicable as part of the default mechanism.
If `moc` is invoked with `-no-timer`, the importing will fail. Furthermore, if passed `--trap-on-call-error`, a congested canister send queue may prevent timer expirations to execute at runtime. It may also deactivate the global timer.

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 heartbeat mechanism should be considered.
The resolution of the timers is similar to the block rate,
so durations should be chosen well above that. For frequent
canister wake-ups, consider using the [heartbeat](https://internetcomputer.org/docs/current/motoko/main/writing-motoko/heartbeats) mechanism; however, when possible, canisters should prefer timers.

Note: The functionality described below is enabled only when the actor does not override it by declaring an explicit `system func timer`.
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.
Timers are _not_ persisted across upgrades. One possible strategy
to re-establish timers after an upgrade is to use 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.
Using timers for security (e.g., access control) is strongly discouraged.
Make 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 as well as 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
For further usage information for timers on the IC, please consult
[the documentation](https://internetcomputer.org/docs/current/developer-docs/backend/periodic-tasks#timers-library-limitations).

## Type `Duration`
``` motoko no-repl
Expand Down Expand Up @@ -79,8 +77,8 @@ Cancels a still active timer with `(id : TimerId)`. For expired timers
and not recognised `id`s nothing happens.

```motoko no-repl
func deleteAppt(appt : Appointment) {
cancelTimer (appt.reminder);
func deleteAppointment(appointment : Appointment) {
cancelTimer (appointment.reminder);
// ...
};
```
2 changes: 1 addition & 1 deletion doc/md/base/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* [Stack](Stack.md) Class `Stack<X>` provides a Minimal LIFO stack of elements of type `X`.
* [Text](Text.md) Utility functions for `Text` values.
* [Time](Time.md) System time
* [Timer](Timer.md) Timers for one-off or periodic tasks.
* [Timer](Timer.md) Timers for one-off or periodic tasks. Applicable as part of the default mechanism.
* [Trie](Trie.md) Functional key-value hash maps.
* [TrieMap](TrieMap.md) Class `TrieMap<K, V>` provides a map from keys of type `K` to values of type `V`.
* [TrieSet](TrieSet.md) Functional set

0 comments on commit e8bd4a7

Please sign in to comment.