@durable-streams/state 0.1.2 → 0.1.4
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/index.cjs +2 -1
- package/dist/index.js +2 -1
- package/package.json +3 -3
- package/src/stream-db.ts +2 -1
package/dist/index.cjs
CHANGED
|
@@ -484,7 +484,7 @@ function createStreamDB(options) {
|
|
|
484
484
|
});
|
|
485
485
|
let batchCount = 0;
|
|
486
486
|
let lastBatchTime = Date.now();
|
|
487
|
-
streamResponse.subscribeJson(
|
|
487
|
+
streamResponse.subscribeJson((batch) => {
|
|
488
488
|
try {
|
|
489
489
|
batchCount++;
|
|
490
490
|
lastBatchTime = Date.now();
|
|
@@ -503,6 +503,7 @@ function createStreamDB(options) {
|
|
|
503
503
|
dispatcher.rejectAll(error);
|
|
504
504
|
abortController.abort();
|
|
505
505
|
}
|
|
506
|
+
return Promise.resolve();
|
|
506
507
|
});
|
|
507
508
|
const healthCheck = setInterval(() => {
|
|
508
509
|
const timeSinceLastBatch = Date.now() - lastBatchTime;
|
package/dist/index.js
CHANGED
|
@@ -460,7 +460,7 @@ function createStreamDB(options) {
|
|
|
460
460
|
});
|
|
461
461
|
let batchCount = 0;
|
|
462
462
|
let lastBatchTime = Date.now();
|
|
463
|
-
streamResponse.subscribeJson(
|
|
463
|
+
streamResponse.subscribeJson((batch) => {
|
|
464
464
|
try {
|
|
465
465
|
batchCount++;
|
|
466
466
|
lastBatchTime = Date.now();
|
|
@@ -479,6 +479,7 @@ function createStreamDB(options) {
|
|
|
479
479
|
dispatcher.rejectAll(error);
|
|
480
480
|
abortController.abort();
|
|
481
481
|
}
|
|
482
|
+
return Promise.resolve();
|
|
482
483
|
});
|
|
483
484
|
const healthCheck = setInterval(() => {
|
|
484
485
|
const timeSinceLastBatch = Date.now() - lastBatchTime;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@durable-streams/state",
|
|
3
3
|
"description": "State change event protocol for Durable Streams",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.4",
|
|
5
5
|
"author": "Durable Stream contributors",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@standard-schema/spec": "^1.0.0",
|
|
47
47
|
"@tanstack/db": "latest",
|
|
48
|
-
"@durable-streams/client": "0.1.
|
|
48
|
+
"@durable-streams/client": "0.1.4"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"tsdown": "^0.9.0",
|
|
52
|
-
"@durable-streams/server": "0.1.
|
|
52
|
+
"@durable-streams/server": "0.1.5"
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|
|
55
55
|
"node": ">=18.0.0"
|
package/src/stream-db.ts
CHANGED
|
@@ -823,7 +823,7 @@ export function createStreamDB<
|
|
|
823
823
|
let lastBatchTime = Date.now()
|
|
824
824
|
|
|
825
825
|
// Process events as they come in
|
|
826
|
-
streamResponse.subscribeJson(
|
|
826
|
+
streamResponse.subscribeJson((batch) => {
|
|
827
827
|
try {
|
|
828
828
|
batchCount++
|
|
829
829
|
lastBatchTime = Date.now()
|
|
@@ -863,6 +863,7 @@ export function createStreamDB<
|
|
|
863
863
|
abortController.abort()
|
|
864
864
|
// Don't rethrow - we've already rejected the promise
|
|
865
865
|
}
|
|
866
|
+
return Promise.resolve()
|
|
866
867
|
})
|
|
867
868
|
|
|
868
869
|
// Health check to detect silent stalls
|