Implementing first "strategy" for proof of concept
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user