You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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`.
Copy file name to clipboardExpand all lines: src/content/docs/durable-objects/api/storage-api.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -233,7 +233,7 @@ The `put()` method returns a `Promise`, but most applications can discard this p
233
233
234
234
<br/> If `setAlarm()` is called with a time equal to or before `Date.now()`, the alarm will be scheduled for asynchronous execution in the immediate future. If the alarm handler is currently executing in this case, it will not be canceled. Alarms can be set to millisecond granularity and will usually execute within a few milliseconds after the set time, but can be delayed by up to a minute due to maintenance or failures while failover takes place.
- Keeps a copy of `value` in memory (not on disk) to survive hibernation. The value can be any type supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), which is true of most types.
33
33
34
34
- If you modify `value` after calling this method, those changes will not be retained unless you call this method again. The serialized size of `value` is limited to 2,048 bytes, otherwise this method will throw an error. If you need larger values to survive hibernation, use the [Storage API](/durable-objects/api/storage-api/) and pass the corresponding key to this method so it can be retrieved later.
35
35
36
-
### deserializeAttachment
36
+
### `deserializeAttachment`
37
37
38
38
-`deserializeAttachment()`: <Typetext='any' />
39
39
40
40
- Retrieves the most recent value passed to `serializeAttachment()`, or `null` if none exists.
@@ -53,7 +53,7 @@ To learn more about WebSocket Hibernation, refer to [Build a WebSocket server wi
53
53
54
54
- The WebSocket Hibernation API permits a maximum of 32,768 WebSocket connections per Durable Object, but the CPU and memory usage of a given workload may further limit the practical number of simultaneous connections.
- Returns an Array of tags associated with the given WebSocket. Throws an error if you have not called `state.acceptWebSocket()` on the given WebSocket.
@@ -86,21 +86,21 @@ To learn more about WebSocket Hibernation, refer to [Build a WebSocket server wi
86
86
87
87
- If `state.setWebSocketAutoResponse()` is set without any argument, it will remove any previously set auto-response configuration. Setting `state.setWebSocketAutoResponse()` without any argument will stop a Durable Object from replying with `response` for a `request`. It will also stop updating the last timestamp of a `request`, but if there was any auto-response timestamp set, it will remain accessible with `state.getWebSocketAutoResponseTimestamp()`.
- Gets the <code>WebSocketRequestResponsePair(request <Typetext='string'/>, response <Typetext='string'/>)</code> currently set, or `null` if there is none.
94
94
95
95
- Each <code>WebSocketRequestResponsePair(request <Typetext='string'/>, response <Typetext='string'/>)</code> Object provides methods for `getRequest()` and `getResponse()`.
- Gets the most recent `Date` when the WebSocket received an auto-response request, or `null` if the given WebSocket never received an auto-response request.
@@ -128,15 +128,15 @@ To learn more about WebSocket Hibernation, refer to [Build a WebSocket server wi
128
128
129
129
- This method is not called for WebSocket control frames. The system will respond to an incoming [WebSocket protocol ping](https://www.rfc-editor.org/rfc/rfc6455#section-5.5.2) automatically without interrupting hibernation.
0 commit comments