Refactoring TFuture
This commit is contained in:
@@ -94,7 +94,7 @@ const
|
||||
CExpectedResult = 42;
|
||||
begin
|
||||
// Use TMycLatch.Null for an already set init state [cite: 71, 81, 206, 216, 324, 334]
|
||||
LInitStateAsState := State.Null;
|
||||
LInitStateAsState := TState.Null;
|
||||
|
||||
LFuture := TMycInitStateFuncFuture<Integer>.Create(FTaskFactory, LInitStateAsState,
|
||||
function: Integer
|
||||
@@ -120,7 +120,7 @@ var
|
||||
const
|
||||
CExpectedResult = 'ChainCompleted';
|
||||
begin
|
||||
LInitLatch := State.CreateLatch(1); // Create an init state that is not yet set [cite: 77, 212, 330]
|
||||
LInitLatch := TState.CreateLatch(1); // Create an init state that is not yet set [cite: 77, 212, 330]
|
||||
|
||||
LFuture := TMycInitStateFuncFuture<string>.Create(FTaskFactory, LInitLatch.State,
|
||||
function: string
|
||||
@@ -155,7 +155,7 @@ const
|
||||
begin
|
||||
LExpectedExceptionRaisedByFactory := False;
|
||||
LLocalTaskFactory := TMycTaskFactory.Create;
|
||||
LInitStateAsState := State.Null; // Immediate execution
|
||||
LInitStateAsState := TState.Null; // Immediate execution
|
||||
|
||||
LFuture := TMycInitStateFuncFuture<Integer>.Create(LLocalTaskFactory, LInitStateAsState,
|
||||
function: Integer
|
||||
@@ -208,7 +208,7 @@ var
|
||||
LFuture: IMycFuture<Integer>;
|
||||
LInitLatch: IMycLatch;
|
||||
begin
|
||||
LInitLatch := State.CreateLatch(1);
|
||||
LInitLatch := TState.CreateLatch(1);
|
||||
|
||||
LFuture := TMycInitStateFuncFuture<Integer>.Create(FTaskFactory, LInitLatch.State,
|
||||
function: Integer
|
||||
@@ -250,7 +250,7 @@ begin
|
||||
FProcExecutionCount := 0; // Reset for this test
|
||||
|
||||
// Gate Latch: MainFuture waits for this latch, which needs 2 notifications.
|
||||
LGateLatch := State.CreateLatch(2); // [cite: 77, 212, 330]
|
||||
LGateLatch := TState.CreateLatch(2); // [cite: 77, 212, 330]
|
||||
|
||||
// Create MainFuture, AInitState is the GateLatch's state.
|
||||
LMainFuture := TMycInitStateFuncFuture<string>.Create(FTaskFactory, LGateLatch.State,
|
||||
@@ -262,7 +262,7 @@ begin
|
||||
|
||||
// Setup Prerequisite Futures
|
||||
// PrerequisiteFuture1
|
||||
LInitStateP1 := State.CreateLatch(1); // Controllable init state for PF1
|
||||
LInitStateP1 := TState.CreateLatch(1); // Controllable init state for PF1
|
||||
LPrerequisiteFuture1 := TMycInitStateFuncFuture<Integer>.Create(FTaskFactory, LInitStateP1.State,
|
||||
function: Integer
|
||||
begin
|
||||
@@ -273,7 +273,7 @@ begin
|
||||
Subscriptions[1] := LPrerequisiteFuture1.Done.Subscribe(LSub1); // Subscribe to PF1's completion [cite: 56, 188, 306]
|
||||
|
||||
// PrerequisiteFuture2
|
||||
LInitStateP2 := State.CreateLatch(1); // Controllable init state for PF2
|
||||
LInitStateP2 := TState.CreateLatch(1); // Controllable init state for PF2
|
||||
LPrerequisiteFuture2 := TMycInitStateFuncFuture<Integer>.Create(FTaskFactory, LInitStateP2.State,
|
||||
function: Integer
|
||||
begin
|
||||
@@ -322,7 +322,7 @@ begin
|
||||
LFlagFutureBRan := False;
|
||||
Self.FSharedCounter := 0; // Reset shared counter for this test
|
||||
|
||||
LTriggerLatch := State.CreateLatch(1); // Single trigger [cite: 77, 212, 330]
|
||||
LTriggerLatch := TState.CreateLatch(1); // Single trigger [cite: 77, 212, 330]
|
||||
|
||||
// Future A
|
||||
LFutureA := TMycInitStateFuncFuture<Integer>.Create(FTaskFactory, LTriggerLatch.State,
|
||||
|
||||
Reference in New Issue
Block a user