reflectdb 0.1.3 → 0.2.0
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/README.md +483 -17
- package/dist/cjs/htmx/index.cjs +1720 -0
- package/dist/cjs/htmx/index.d.cts +760 -0
- package/dist/cjs/server/index.cjs +12 -0
- package/dist/cjs/server/index.d.cts +14 -0
- package/dist/cjs/server/storage/object/index.cjs +2284 -0
- package/dist/cjs/server/storage/object/index.d.cts +578 -0
- package/dist/cjs/transport/sse.cjs +52 -1
- package/dist/cjs/transport/sse.d.cts +34 -0
- package/dist/htmx/index.d.ts +760 -0
- package/dist/htmx/index.js +297 -0
- package/dist/server/drizzle.js +2 -1
- package/dist/server/index.d.ts +14 -0
- package/dist/server/index.js +16 -2
- package/dist/server/storage/object/index.d.ts +578 -0
- package/dist/server/storage/object/index.js +2232 -0
- package/dist/shared/{esm-77ndhmpv.js → esm-5ahpq25j.js} +4 -14
- package/dist/shared/esm-dcs8qa5n.js +263 -0
- package/dist/shared/esm-f11s9zpb.js +15 -0
- package/dist/transport/sse.d.ts +34 -0
- package/dist/transport/sse.js +52 -1
- package/dist/vanilla/index.js +4 -260
- package/package.json +23 -1
|
@@ -2527,6 +2527,18 @@ class MessageHandler {
|
|
|
2527
2527
|
storage = null;
|
|
2528
2528
|
minSchemaVersion = 0;
|
|
2529
2529
|
messageQueues = new Map;
|
|
2530
|
+
async whenIdle(clientId) {
|
|
2531
|
+
for (let i = 0;i < 100; i++) {
|
|
2532
|
+
const queue = this.messageQueues.get(clientId);
|
|
2533
|
+
if (!queue)
|
|
2534
|
+
return;
|
|
2535
|
+
await queue.catch(() => {
|
|
2536
|
+
return;
|
|
2537
|
+
});
|
|
2538
|
+
if (this.messageQueues.get(clientId) === queue)
|
|
2539
|
+
return;
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2530
2542
|
resultCache = new ResultCache;
|
|
2531
2543
|
broadcast;
|
|
2532
2544
|
ops;
|
|
@@ -769,6 +769,20 @@ declare class MessageHandler<TAuth extends AuthContext = AuthContext> {
|
|
|
769
769
|
private storage;
|
|
770
770
|
private minSchemaVersion;
|
|
771
771
|
private messageQueues;
|
|
772
|
+
/**
|
|
773
|
+
* Resolves once every message queued for `clientId` has finished processing.
|
|
774
|
+
*
|
|
775
|
+
* Messages are handled on a per-client serial queue, and `onMessage` returns
|
|
776
|
+
* before that work settles — fine for a long-lived connection, where replies
|
|
777
|
+
* stream out whenever they are ready. A serverless HTTP handler has no such
|
|
778
|
+
* luxury: it must know when the replies to the request it is holding exist,
|
|
779
|
+
* or it returns an empty body and the client hangs. See the SSE transport's
|
|
780
|
+
* `serverless` mode.
|
|
781
|
+
*
|
|
782
|
+
* Never rejects: a failed message is the caller's concern via its own reply,
|
|
783
|
+
* not this barrier's.
|
|
784
|
+
*/
|
|
785
|
+
whenIdle(clientId: string): Promise<void>;
|
|
772
786
|
private resultCache;
|
|
773
787
|
private broadcast;
|
|
774
788
|
private ops;
|