Add breakpoints and ack-based comms to worker
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { StepExecutionResult } from "./types";
|
||||
|
||||
/** Types of requests the worker handles */
|
||||
export type WorkerRequestData =
|
||||
| {
|
||||
type: "Init";
|
||||
@@ -13,11 +14,19 @@ export type WorkerRequestData =
|
||||
type: "Prepare";
|
||||
params: { code: string; input: string };
|
||||
}
|
||||
| {
|
||||
type: "UpdateBreakpoints";
|
||||
params: { points: number[] };
|
||||
}
|
||||
| {
|
||||
type: "Execute";
|
||||
params: { interval?: number };
|
||||
};
|
||||
|
||||
/** Kinds of acknowledgement responses the worker can send */
|
||||
export type WorkerAckType = "init" | "reset" | "bp-update" | "prepare";
|
||||
|
||||
/** Types of responses the worker can send */
|
||||
export type WorkerResponseData<RS> =
|
||||
| { type: "state"; data: "empty" | "ready" }
|
||||
| { type: "ack"; data: WorkerAckType }
|
||||
| { type: "result"; data: StepExecutionResult<RS> };
|
||||
|
||||
Reference in New Issue
Block a user