From b781607b9fbe051cac1e1cc35ad185132ec9a8ec Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Thu, 24 Oct 2024 20:51:18 -0400 Subject: [PATCH] Wrap shutdown promises in call --- lib/race.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/race.ts b/lib/race.ts index 564a93e5..cff7310f 100644 --- a/lib/race.ts +++ b/lib/race.ts @@ -3,6 +3,7 @@ import { encapsulate, trap } from "./task.ts"; import type { Operation, Task, Yielded } from "./types.ts"; import { withResolvers } from "./with-resolvers.ts"; import { Err, Ok, Result } from "./result.ts"; +import { call } from './call.ts'; //import { useScope } from "./scope.ts"; //import { transfer } from "./scope.ts"; @@ -68,7 +69,7 @@ export function* race>( } for (let task of shutdown) { - yield* task; + yield* call(() => task); } if (result.ok) {