Moved signal interfaces inside records

This commit is contained in:
Michael Schimmel
2025-06-05 23:27:48 +02:00
parent 7ba42b0c7c
commit a57b2d50e4
15 changed files with 316 additions and 313 deletions
+6 -6
View File
@@ -9,14 +9,14 @@ uses
type
IMycTaskManager = interface
// TOD Dokumentation
function CreateTask(const Gate: TState; const Proc: TProc): TSubscription;
function CreateTask(const Gate: TState; const Proc: TProc): TSignal.TSubscription;
// Waits for the operation associated with State to complete.
// Must not be called from a worker thread of this factory.
// After waiting, or if the state is already set, any first stored exception
// from any worker thread of this factory will be re-raised in the calling (main) thread.
// Raises ETaskException if called from within a worker thread.
procedure WaitFor(State: IMycState);
procedure WaitFor(State: TState.IState);
end;
var
@@ -41,8 +41,8 @@ type
TMycTaskManagerMock = class(TInterfacedObject, IMycTaskManager)
public
// IMycTaskManager
function CreateTask(const Gate: TState; const Proc: TProc): TSubscription;
procedure WaitFor(State: IMycState);
function CreateTask(const Gate: TState; const Proc: TProc): TSignal.TSubscription;
procedure WaitFor(State: TState.IState);
constructor Create;
end;
@@ -72,12 +72,12 @@ begin
inherited Create;
end;
function TMycTaskManagerMock.CreateTask(const Gate: TState; const Proc: TProc): TSubscription;
function TMycTaskManagerMock.CreateTask(const Gate: TState; const Proc: TProc): TSignal.TSubscription;
begin
Result := Gate.Subscribe(TMycExecMock.Create(Proc));
end;
procedure TMycTaskManagerMock.WaitFor(State: IMycState);
procedure TMycTaskManagerMock.WaitFor(State: TState.IState);
begin
Assert(State.IsSet);
end;