|
61 | 61 | * @example |
62 | 62 | * ```typescript |
63 | 63 | * class MySyncletDurableObject extends SyncletDurableObject { |
64 | | - * getCreateComponents() { |
65 | | - * return { |
66 | | - * dataConnector: createDurableObjectSqliteDataConnector({ |
67 | | - * depth: 3, |
68 | | - * sqlStorage: this.ctx.storage.sql, |
69 | | - * }), |
70 | | - * }; |
| 64 | + * getCreateDataConnector() { |
| 65 | + * return createDurableObjectSqliteDataConnector({ |
| 66 | + * depth: 3, |
| 67 | + * sqlStorage: this.ctx.storage.sql, |
| 68 | + * }); |
71 | 69 | * } |
72 | 70 | * } |
73 | 71 | * ``` |
|
130 | 128 | * @example |
131 | 129 | * ```typescript |
132 | 130 | * class MySyncletDurableObject extends SyncletDurableObject { |
133 | | - * getCreateComponents() { |
134 | | - * return { |
135 | | - * metaConnector: createDurableObjectSqliteMetaConnector({ |
136 | | - * depth: 3, |
137 | | - * sqlStorage: this.ctx.storage.sql, |
138 | | - * }), |
139 | | - * }; |
| 131 | + * getCreateMetaConnector() { |
| 132 | + * return createDurableObjectSqliteMetaConnector({ |
| 133 | + * depth: 3, |
| 134 | + * sqlStorage: this.ctx.storage.sql, |
| 135 | + * }); |
140 | 136 | * } |
141 | 137 | * } |
142 | 138 | * ``` |
|
254 | 250 | * @example |
255 | 251 | * ```typescript |
256 | 252 | * class MyBrokerDurableObject extends SyncletDurableObject { |
257 | | - * getCreateComponents() { |
258 | | - * return { |
259 | | - * transport: createDurableObjectBrokerTransport({ |
260 | | - * durableObject: this, |
261 | | - * path: null, // Broker-only mode |
262 | | - * brokerPaths: /^room-[a-z0-9]+$/, // Only accept specific room paths |
263 | | - * }), |
264 | | - * }; |
| 253 | + * getCreateTransport() { |
| 254 | + * return createDurableObjectBrokerTransport({ |
| 255 | + * durableObject: this, |
| 256 | + * path: null, // Broker-only mode |
| 257 | + * brokerPaths: /^room-[a-z0-9]+$/, // Only accept specific room paths |
| 258 | + * }); |
265 | 259 | * } |
266 | 260 | * } |
267 | 261 | * ``` |
|
274 | 268 | * The SyncletDurableObject class is an abstract base class for creating |
275 | 269 | * Synclet-powered Durable Objects. |
276 | 270 | * |
277 | | - * Extend this class and optionally implement the `createDataConnector` and |
278 | | - * `createMetaConnector` methods to define how your Durable Object stores data |
279 | | - * and metadata. The class automatically manages the Synclet lifecycle |
280 | | - * internally - you don't need to initialize or access the synclet directly. |
| 271 | + * Extend this class and optionally implement the `getCreateDataConnector`, |
| 272 | + * `getCreateMetaConnector`, and `getCreateTransport` methods to define how |
| 273 | + * your Durable Object stores data and metadata, and how it communicates. The |
| 274 | + * class automatically manages the Synclet lifecycle internally - you don't |
| 275 | + * need to initialize or access the synclet directly. |
281 | 276 | * |
282 | | - * Optionally implement `getSyncletImplementations` or `getSyncletOptions` to |
| 277 | + * Optionally implement `getCreateImplementations` or `getCreateOptions` to |
283 | 278 | * configure custom implementations or other options. |
284 | 279 | * @example |
285 | 280 | * ```typescript |
286 | 281 | * class MySyncletDurableObject extends SyncletDurableObject { |
287 | | - * createDataConnector() { |
| 282 | + * getCreateDataConnector() { |
288 | 283 | * return createMemoryDataConnector({depth: 3}); |
289 | 284 | * } |
290 | | - * createMetaConnector() { |
| 285 | + * getCreateMetaConnector() { |
291 | 286 | * return createMemoryMetaConnector({depth: 3}); |
292 | 287 | * } |
293 | | - * getSyncletOptions() { |
| 288 | + * getCreateOptions() { |
294 | 289 | * return {logLevel: 'debug'}; |
295 | 290 | * } |
296 | 291 | * } |
|
309 | 304 | */ |
310 | 305 | /// SyncletDurableObject.constructor |
311 | 306 | /** |
312 | | - * The getCreateComponents method can optionally be implemented to provide |
313 | | - * components for creating the Synclet, including data and meta connectors. |
314 | | - * @returns A SyncletComponents object. |
| 307 | + * The getCreateDataConnector method can optionally be implemented to provide |
| 308 | + * a data connector for the Synclet. |
| 309 | + * @returns A DataConnector instance. |
315 | 310 | * @category Creation |
316 | 311 | * @since v0.0.0 |
317 | 312 | */ |
318 | | - /// SyncletDurableObject.getCreateComponents |
| 313 | + /// SyncletDurableObject.getCreateDataConnector |
| 314 | + /** |
| 315 | + * The getCreateMetaConnector method can optionally be implemented to provide |
| 316 | + * a meta connector for the Synclet. |
| 317 | + * @returns A MetaConnector instance. |
| 318 | + * @category Creation |
| 319 | + * @since v0.0.0 |
| 320 | + */ |
| 321 | + /// SyncletDurableObject.getCreateMetaConnector |
| 322 | + /** |
| 323 | + * The getCreateTransport method can optionally be implemented to provide |
| 324 | + * a transport or array of transports for the Synclet. |
| 325 | + * @returns A Transport instance or array of Transport instances. |
| 326 | + * @category Creation |
| 327 | + * @since v0.0.0 |
| 328 | + */ |
| 329 | + /// SyncletDurableObject.getCreateTransport |
319 | 330 | /** |
320 | 331 | * The getCreateImplementations method can optionally be implemented to |
321 | 332 | * provide custom implementations for Synclet lifecycle hooks, conflict |
|
0 commit comments