sdk: add cluster manager

This commit is contained in:
Koushik Dutta
2024-11-20 10:10:47 -08:00
parent 459b95a0e2
commit 347a957cd3
15 changed files with 144 additions and 48 deletions

View File

@@ -207,6 +207,8 @@ export function startClusterClient(mainFilename: string) {
unzippedPath,
zipHash,
}, undefined);
runtimeWorker.stdout.on('data', data => console.log(data.toString()));
runtimeWorker.stderr.on('data', data => console.error(data.toString()));
const threadPeer = new RpcPeer('main', 'thread', (message, reject, serializationContext) => runtimeWorker.send(message, reject, serializationContext));
runtimeWorker.setupRpcPeer(threadPeer);

View File

@@ -1,7 +1,6 @@
import type { ScryptedRuntime } from "../runtime";
import { matchesClusterLabels } from "../cluster/cluster-labels";
import type { ScryptedRuntime } from "../runtime";
import { ClusterForkOptions, ClusterForkParam, ClusterWorker, PeerLiveness } from "../scrypted-cluster-main";
import { RpcPeer } from "../rpc";
export class ClusterFork {
constructor(public runtime: ScryptedRuntime) { }