@base44-preview/sdk 0.8.53-pr.289.08abc72 → 0.8.53-pr.289.26df536
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/actors.types.d.ts +14 -12
- package/package.json +1 -1
|
@@ -73,8 +73,8 @@ export interface ActorSubscription {
|
|
|
73
73
|
unsubscribe(): void;
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
|
-
* Represents a client's
|
|
77
|
-
* [`connect()`](#connect). The
|
|
76
|
+
* Represents a client's WebSocket connection to an actor session, returned after calling
|
|
77
|
+
* [`connect()`](#connect). The socket queues messages you send before it opens.
|
|
78
78
|
*
|
|
79
79
|
* Learn more about
|
|
80
80
|
* [connections](/developers/backend/resources/actors/reference#connections).
|
|
@@ -105,8 +105,8 @@ export interface Connection<N extends string = string> {
|
|
|
105
105
|
/**
|
|
106
106
|
* Sends a message to the actor.
|
|
107
107
|
*
|
|
108
|
-
* The
|
|
109
|
-
* the
|
|
108
|
+
* The socket queues messages until it opens. When you call {@linkcode Connection.close | close()},
|
|
109
|
+
* the socket drops any further sent messages.
|
|
110
110
|
*
|
|
111
111
|
* @param data - Message to send to the actor. The type comes from {@linkcode ActorRegistry} when you register the actor there.
|
|
112
112
|
*
|
|
@@ -134,11 +134,11 @@ export interface Connection<N extends string = string> {
|
|
|
134
134
|
/**
|
|
135
135
|
* Represents a reference to an actor session, identified by actor name and session ID.
|
|
136
136
|
*
|
|
137
|
-
* Call {@linkcode ActorRef.connect | connect()} to open the WebSocket and get a [
|
|
137
|
+
* Call {@linkcode ActorRef.connect | connect()} to open the WebSocket and get a [Connection](#returns).
|
|
138
138
|
*/
|
|
139
139
|
export interface ActorRef<N extends string = string> {
|
|
140
140
|
/**
|
|
141
|
-
* Creates or returns the
|
|
141
|
+
* Creates or returns the [Connection](#returns) for this session.
|
|
142
142
|
*
|
|
143
143
|
* Calling `connect()` again on the same session reference returns the same
|
|
144
144
|
* connection until it closes.
|
|
@@ -147,7 +147,7 @@ export interface ActorRef<N extends string = string> {
|
|
|
147
147
|
* [connect a client to a session](/developers/backend/resources/actors/sample-flows#connect-a-client-to-a-session).
|
|
148
148
|
*
|
|
149
149
|
* @param options - Optional connection settings, such as a stable connection ID.
|
|
150
|
-
* @returns The
|
|
150
|
+
* @returns The [Connection](#returns) for this actor session.
|
|
151
151
|
*
|
|
152
152
|
* @example
|
|
153
153
|
* ```typescript
|
|
@@ -182,17 +182,19 @@ export interface ActorClient<N extends string = string> {
|
|
|
182
182
|
(instanceId: string): ActorRef<N>;
|
|
183
183
|
}
|
|
184
184
|
/**
|
|
185
|
-
* Actors module for
|
|
185
|
+
* Actors module for connecting a client to [actor](/developers/backend/resources/actors/overview) sessions, managing connections, and exchanging messages.
|
|
186
186
|
*
|
|
187
187
|
* An actor is a long-running backend process that multiple clients connect to simultaneously. A session
|
|
188
188
|
* is a running instance of an actor, identified by the actor name and a session ID. Each
|
|
189
189
|
* session manages its own state, storage, and client connections independently.
|
|
190
190
|
*
|
|
191
|
-
* The actors module
|
|
191
|
+
* The actors module supports several objects with the following functionality:
|
|
192
192
|
*
|
|
193
|
-
* -
|
|
194
|
-
* -
|
|
195
|
-
* -
|
|
193
|
+
* - {@linkcode ActorRef.connect | connect()}: Open a WebSocket connection to a session.
|
|
194
|
+
* - {@linkcode Connection.subscribe | subscribe()}: Receive messages from the actor.
|
|
195
|
+
* - {@linkcode ActorSubscription.unsubscribe | unsubscribe()}: Stop receiving messages from the actor without closing the connection.
|
|
196
|
+
* - {@linkcode Connection.send | send()}: Send messages to the actor.
|
|
197
|
+
* - {@linkcode Connection.close | close()}: Close the WebSocket connection to the actor.
|
|
196
198
|
*
|
|
197
199
|
* For a sample flow, see
|
|
198
200
|
* [connect a client to a session](/developers/backend/resources/actors/sample-flows#connect-a-client-to-a-session).
|