milkio 0.2.17 → 0.2.18
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.
|
@@ -179,7 +179,7 @@ export function defineHttpHandler(app: MilkioApp, options: ExecuteHttpServerOpti
|
|
|
179
179
|
stream = new ReadableStream({
|
|
180
180
|
async pull(controller) {
|
|
181
181
|
control = controller;
|
|
182
|
-
controller.enqueue(`data
|
|
182
|
+
controller.enqueue(`data:@${JSON.stringify(TSON.encode(resultsRaw.$result))}\n\n`);
|
|
183
183
|
controller.close();
|
|
184
184
|
},
|
|
185
185
|
cancel() {
|
|
@@ -198,7 +198,7 @@ export function defineHttpHandler(app: MilkioApp, options: ExecuteHttpServerOpti
|
|
|
198
198
|
async pull(controller: ReadableStreamDirectController) {
|
|
199
199
|
control = controller;
|
|
200
200
|
try {
|
|
201
|
-
controller.write(`data
|
|
201
|
+
controller.write(`data:@${JSON.stringify(TSON.encode(resultsRaw.$result))}\n\n`);
|
|
202
202
|
for await (const value of generator) {
|
|
203
203
|
if (!request.request.signal.aborted) {
|
|
204
204
|
const result: string = JSON.stringify(TSON.encode(value));
|
|
@@ -210,7 +210,7 @@ export function defineHttpHandler(app: MilkioApp, options: ExecuteHttpServerOpti
|
|
|
210
210
|
}
|
|
211
211
|
} catch (error) {
|
|
212
212
|
const result = handleCatchError(error, executeId);
|
|
213
|
-
controller.write(`data
|
|
213
|
+
controller.write(`data:@${JSON.stringify(TSON.encode(result))}\n\n`);
|
|
214
214
|
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
215
215
|
}
|
|
216
216
|
controller.close();
|
|
@@ -225,7 +225,7 @@ export function defineHttpHandler(app: MilkioApp, options: ExecuteHttpServerOpti
|
|
|
225
225
|
async pull(controller) {
|
|
226
226
|
control = controller;
|
|
227
227
|
try {
|
|
228
|
-
controller.enqueue(`data
|
|
228
|
+
controller.enqueue(`data:@${JSON.stringify(TSON.encode(resultsRaw.$result))}\n\n`);
|
|
229
229
|
for await (const value of generator) {
|
|
230
230
|
if (!request.request.signal.aborted) {
|
|
231
231
|
const result: string = JSON.stringify(TSON.encode(value));
|
|
@@ -237,7 +237,7 @@ export function defineHttpHandler(app: MilkioApp, options: ExecuteHttpServerOpti
|
|
|
237
237
|
}
|
|
238
238
|
} catch (error) {
|
|
239
239
|
const result = handleCatchError(error, executeId);
|
|
240
|
-
controller.enqueue(`data
|
|
240
|
+
controller.enqueue(`data:@${JSON.stringify(TSON.encode(result))}\n\n`);
|
|
241
241
|
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
242
242
|
}
|
|
243
243
|
controller.close();
|