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
The `DurableObjectState` interface is accessible as an instance property on the Durable Objects class. This interface encapsulates methods that modify the state of a Durable Object, for example which WebSockets are attached to a Durable Object instance or how the runtime should handle concurrent Durable Object requests.
13
13
14
-
The `DurableObjectState` interface is different that the [Storage API](/durable-objects/api/storage-api) in that it does not have toplevel methods which manipulate persistant application data. These methods are instead encapsulated in the [`DurableObjectStorage`](/durable-objects/api/storage-api) interface and accessed by [`DurableObjectState::storage`](/durable-objects/api/state/#storage).
14
+
The `DurableObjectState` interface is different from the [Storage API](/durable-objects/api/storage-api) in that it does not have top-level methods which manipulate persistent application data. These methods are instead encapsulated in the [`DurableObjectStorage`](/durable-objects/api/storage-api) interface and accessed by [`DurableObjectState::storage`](/durable-objects/api/state/#storage).
@@ -108,7 +108,7 @@ export class MyDurableObject extends DurableObject {
108
108
109
109
`acceptWebSocket` is part of the [WebSocket Hibernation API](durable-objects/reference/websockets/#websocket-hibernation), which allows a Durable Object instance to be removed from memory to save costs while keeping its WebSockets connected.
110
110
111
-
`acceptWebSocket` adds a WebSocket to the set of WebSockets attached to the Durable Object instance. Once called, any incoming messages will be delivered by calling the Durable Object’s `webSocketMessage` handler, and `webSocketClose` will be invoked upon disconnect. After calling `acceptWebSocket`, the WebSocket is accepted and its `send` and `close` methods can be used.
111
+
`acceptWebSocket` adds a WebSocket to the set of WebSockets attached to the Durable Object instance. Once called, any incoming messages will be delivered by calling the Durable Object's `webSocketMessage` handler, and `webSocketClose` will be invoked upon disconnect. After calling `acceptWebSocket`, the WebSocket is accepted and its `send` and `close` methods can be used.
112
112
113
113
The [WebSocket Hibernation API](durable-objects/reference/websockets/#websocket-hibernation) takes the place of the standard [WebSockets API](/workers/runtime-apis/websockets/). Therefore, `ws.accept` must not have been called separately and `ws.addEventListener` method will not receive events as they will instead be delivered to the Durable Object.
114
114
@@ -131,7 +131,7 @@ The WebSocket Hibernation API permits a maximum of 32,768 WebSocket connections
131
131
132
132
:::note[`waitUntil` is not necessary]
133
133
134
-
Disconnected WebSockets are not returned by this method, but `getWebSockets` may still return websockets even after `ws.close` has been called. For example, if the server-side WebSocket sends a close, but does not receive one back (and has not detected a disconnect from the client), then the connection is in the CLOSING “readyState”. The client might send more messages, so the WebSocket is technically not disconnected.
134
+
Disconnected WebSockets are not returned by this method, but `getWebSockets` may still return websockets even after `ws.close` has been called. For example, if the server-side WebSocket sends a close, but does not receive one back (and has not detected a disconnect from the client), then the connection is in the CLOSING 'readyState'. The client might send more messages, so the WebSocket is technically not disconnected.
135
135
136
136
:::
137
137
@@ -237,7 +237,7 @@ If no parameter or a parameter of `0` is provided and a timeout has been previou
237
237
238
238
### `abort`
239
239
240
-
`abort` is used to forcibly reset a Durable Object instance. A JavaScript Error with the message passed as a parameter will be logged. This error is not able to be caught within the applciation code.
240
+
`abort` is used to forcibly reset a Durable Object instance. A JavaScript `Error` with the message passed as a parameter will be logged. This error is not able to be caught within the application code.
0 commit comments