* Started message

This commit is contained in:
Michael Van Canneyt 2025-03-20 14:56:42 +01:00
parent 15d5b68de7
commit 254187c03c

View File

@ -43,6 +43,7 @@ Const
cmdLoaded = 'loaded';
cmdKill = 'kill';
cmdSpawn = 'spawn';
cmdStarted = 'started';
cmdLoad = 'load';
cmdRun = 'run';
cmdExecute = 'execute';
@ -195,6 +196,7 @@ Type
Module : TJSWebAssemblyModule;
end;
{ TWorkerLoadCommandHelper }
TWorkerLoadCommandHelper = class helper for TWorkerLoadCommand
@ -202,6 +204,17 @@ Type
Class function Create(aModule : TJSWebAssemblyModule; aMemory : TJSWebAssemblyMemory): TWorkerLoadCommand; static;reintroduce;
end;
TWorkerStartedCommand = class external name 'Object' (TWorkerCommand)
StartFunction : string;
end;
{ TWorkerStartedCommandHelper }
TWorkerStartedCommandHelper = class helper for TWorkerStartedCommand
Class function CommandName : string; static;
Class function Create(aFunction : string): TWorkerStartedCommand; static;reintroduce;
end;
// Sent by main to worker: run thread procedure
TWorkerRunCommand = class external name 'Object' (TWorkerCommand)
@ -386,6 +399,19 @@ begin
Result.Module:=aModule;
end;
{ TWorkerStartedCommandHelper }
class function TWorkerStartedCommandHelper.CommandName: string;
begin
result:=cmdStarted;
end;
class function TWorkerStartedCommandHelper.Create(aFunction: string): TWorkerStartedCommand;
begin
Result:=TWorkerStartedCommand(TWorkerCommand.NewWorker(CommandName));
Result.StartFunction:=aFunction;
end;
{ TWorkerSpawnThreadCommandHelper }
class function TWorkerSpawnThreadCommandHelper.CommandName: string;