BlueGit

timfa questward

Files

questward / server / src / simulation / inProcessWorker.js

inProcessWorker.js

inProcessWorker.js 363 B Download Raw
1import { WorkerWorld } from "./workerWorld.js";
2
3export class InProcessWorker
4{
5 constructor (workerId)
6 {
7 this.workerId = workerId;
8 this.world = new WorkerWorld(workerId);
9 }
10
11 call (message)
12 {
13 const result = this.world.handle(structuredClone(message));
14 return result === undefined ? undefined : structuredClone(result);
15 }
16
17 async terminate ()
18 {
19 }
20}