Implementing first "strategy" for proof of concept

This commit is contained in:
Michael Schimmel
2025-07-11 11:06:18 +02:00
parent 644b6074d6
commit 487169afe0
20 changed files with 1761 additions and 274 deletions
+16
View File
@@ -14,6 +14,7 @@ type
public
function ProcessSignal(const Signal: TSignal; const Proc: TMsgProc): TComponent; overload;
function ProcessSignal(const Signal: TSignal; const Proc: TProc): TComponent; overload;
function ProcessSignal(const Signal: TSignal; const Done: TState; const Proc: TProc): TComponent; overload;
end;
TSignalSyncHelper = record helper for TSignal
@@ -198,6 +199,21 @@ begin
Result := TSignalSubscriber.Create(Self, Signal, Proc);
end;
function TSignalComponentHelper.ProcessSignal(const Signal: TSignal; const Done: TState; const Proc: TProc): TComponent;
begin
var cProc: TProc := Proc;
var cDone: TState := Done;
Result :=
ProcessSignal(
Signal,
procedure(out IsDone: Boolean)
begin
cProc();
IsDone := cDone.IsSet;
end
);
end;
{ TSignalSyncHelper }
function TSignalSyncHelper.Queue(const Proc: TProc; Delay: Integer = 0): TSignal.TSubscription;