Skip to content

Commit 364991e

Browse files
committed
Clarifying getAlarm behaviour if called while alarm is running.
1 parent 81562e9 commit 364991e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/content/docs/durable-objects/api/alarms.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Alarms can be used to build distributed primitives, like queues or batching of w
3535

3636
- If there is an alarm set, then return the currently set alarm time as the number of milliseconds elapsed since the UNIX epoch. Otherwise, return `null`.
3737

38+
- If `getAlarm` is called while an [`alarm`](/durable-objects/api/alarms/#alarm) is already running, it returns `null` unless `setAlarm` has been called since the alarm handler started running.
39+
3840
### `setAlarm`
3941

4042
- <code>{" "}setAlarm(scheduledTimeMs <Type text="number" />)</code>
@@ -62,6 +64,7 @@ Alarms can be used to build distributed primitives, like queues or batching of w
6264
- `retryCount` <Type text="number"/>: The number of times this alarm event has been retried.
6365
- `isRetry` <Type text="boolean"/>: A boolean value to indicate if the alarm has been retried. This value is `true` if this alarm event is a retry.
6466

67+
6568
- The `alarm()` handler has guaranteed at-least-once execution and will be retried upon failure using exponential backoff, starting at 2 second delays for up to 6 retries. Retries will be performed if the method fails with an uncaught exception.
6669

6770
- This method can be `async`.

0 commit comments

Comments
 (0)