Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): settling a parent settles its tasks on other machines #28344

Closedfelixleopold(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/28344/headopened View on GitHub

Showing 2 changed files with 126 additions and 3 deletions.

x
0 of 2 viewed, 2 left
69 additions and 2 deletionsapps/server/src/peer/RemoteDelegation.test.tsModified
View file
@@ -41,6 +41,7 @@
import * as EventSink from "../orchestration-v2/EventSink.ts";
import * as Orchestrator from "../orchestration-v2/Orchestrator.ts";
import * as ProjectionStore from "../orchestration-v2/ProjectionStore.ts";
+import * as ThreadSearch from "../orchestration-v2/ThreadSearch.ts";
import type * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter";
import * as ProviderAdapterRegistry from "../orchestration-v2/ProviderAdapterRegistry.ts";
import * as ProviderContinuationRequests from "@t3tools/provider-core/server/ProviderContinuationRequests";
@@ -128,6 +129,9 @@
readonly sent: Ref.Ref<ReadonlyArray<string>>;
/** Runs as the launch there is answered, before the laptop hears back. */
readonly afterLaunch: Ref.Ref<Effect.Effect<void>>;
+ /** Threads settled there, in order; `settledOnce` completes on the first. */
+ readonly settled: Ref.Ref<ReadonlyArray<ThreadId>>;
+ readonly settledOnce: Deferred.Deferred<void>;
​
const makeBoxThread = Effect.gen(function* () {
@@ -162,6 +166,8 @@
releaseStop: yield* Deferred.make<void>(),
sent: yield* Ref.make<ReadonlyArray<string>>([]),
afterLaunch: yield* Ref.make<Effect.Effect<void>>(Effect.void),
+ settled: yield* Ref.make<ReadonlyArray<ThreadId>>([]),
+ settledOnce: yield* Deferred.make<void>(),
} satisfies BoxThread;
});
​