Lumiera  0.pre.03
»edit your freedom«
SchedulerActivity_test Class Reference

Description

Test:
verify behaviour of the Scheduler Activity Language.
See also
SchedulerCommutator_test
SchedulerUsage_test

Definition at line 53 of file scheduler-activity-test.cpp.

Private Member Functions

void dispatchChain ()
 
virtual void run (Arg)
 
void scenario_IOJob ()
 
void scenario_MetaJob ()
 
void scenario_Notification ()
 
void scenario_RenderJob ()
 
void simpleUsage ()
 
void termBuilder ()
 
void verifyActivity_Gate_block ()
 
void verifyActivity_Gate_dead ()
 
void verifyActivity_Gate_notify ()
 
void verifyActivity_Gate_opened ()
 
void verifyActivity_Gate_pass ()
 
void verifyActivity_Invoke ()
 
void verifyActivity_Notify ()
 
void verifyActivity_Post ()
 

Additional Inherited Members

- Public Member Functions inherited from Test
virtual void run (Arg arg)=0
 

Member Function Documentation

◆ simpleUsage()

void simpleUsage ( )
inlineprivate
Test:
demonstrate simple Activity usage

Definition at line 82 of file scheduler-activity-test.cpp.

References ActivityMatch::arg(), Time::NEVER, and Activity::WORKSTART.

+ Here is the call graph for this function:

◆ verifyActivity_Post()

void verifyActivity_Post ( )
inlineprivate
Test:
behaviour of Activity::POST
  • invoke the λ-post to dispatch the chain through the queue
  • the chain to be executed is given as next
  • time window for scheduling as data field
  • the start time from this window becomes the when parameter
  • the now parameter from the activation is thus ignored

Definition at line 114 of file scheduler-activity-test.cpp.

References Activity::POST, and Activity::TICK.

◆ verifyActivity_Invoke()

void verifyActivity_Invoke ( )
inlineprivate
Test:
behaviour of Activity::INVOKE
  • setup requires two FEED-Activities to be chained up as arguments
  • use the rigged execution context provided by ActivityDetector
  • can verify this way that the activation leads to JobFunctor invocation

Definition at line 139 of file scheduler-activity-test.cpp.

References Activity::next.

◆ verifyActivity_Notify()

void verifyActivity_Notify ( )
inlineprivate
Test:
behaviour of Activity::NOTIFY when activated
  • notification is dispatched as special message to an indicated target Activity
  • when activated, a NOTIFY-Activity invokes the λ-post with its target,
  • in the actual setup (Scheduler) this leads to dispatching of said target Activity
  • what happens then depends on the target; usually the target is a GATE
  • in first example here, we just use a TICK-Activity
  • for a GATE there is special treatment to inject the timing window of the target into the CTX-post invocation; this is essential to handle long notification-chains properly.

Definition at line 169 of file scheduler-activity-test.cpp.

References ActivityMatch::arg(), ActivityDetector::incrementSeq(), and Time::NEVER.

+ Here is the call graph for this function:

◆ verifyActivity_Gate_pass()

void verifyActivity_Gate_pass ( )
inlineprivate
Test:
behaviour of Activity::GATE: if conditions are met, the activation is just passed, so the executor (in the Scheduler) will just invoke the chain

Definition at line 200 of file scheduler-activity-test.cpp.

References Activity::activate(), ActivityMatch::arg(), and Activity::next.

+ Here is the call graph for this function:

◆ verifyActivity_Gate_dead()

void verifyActivity_Gate_dead ( )
inlineprivate
Test:
behaviour of Activity::GATE: the rest of the chain is just skipped in case of deadline violation

Definition at line 220 of file scheduler-activity-test.cpp.

References Activity::activate(), ActivityMatch::arg(), ActivityDetector::incrementSeq(), and ActivityMatch::seq().

+ Here is the call graph for this function:

◆ verifyActivity_Gate_block()

void verifyActivity_Gate_block ( )
inlineprivate
Test:
behaviour of Activity::GATE: the count-down condition determines if activation passes; otherwise the Gate will just return activity::SKIP
Remarks
in the original design, the Gate would poll for changes by re-scheduling itself into the Future; this behaviour turned out to be unnecessary and problematic.

Definition at line 255 of file scheduler-activity-test.cpp.

References Activity::activate(), ActivityMatch::arg(), and Activity::next.

+ Here is the call graph for this function:

◆ verifyActivity_Gate_notify()

void verifyActivity_Gate_notify ( )
inlineprivate
Test:
behaviour of Activity::GATE:
  • if it is dispatched as new chain, instead of just activating it of part of an ongoing chain, the Gate will receive a notification
  • this results in decrementing the prerequisite latch in the Gate
  • what happens then depends on current state; in this test case the Gate is decremented yet remains closed

Definition at line 281 of file scheduler-activity-test.cpp.

References ActivityMatch::arg(), Activity::dispatch(), and Activity::next.

+ Here is the call graph for this function:

◆ verifyActivity_Gate_opened()

void verifyActivity_Gate_opened ( )
inlineprivate
Test:
behaviour of Activity::GATE on notification
  • Gate configured initially such that it blocks (without violating deadline)
  • thus a regular activation signals to skip the chain.
  • when receiving a notification, the latch is decremented
  • if this causes the Gate to open, the follow-up chain will be activated immediately, but the Gate also locked forever
  • neither a further activation, nor a further notification has any effect after this point...

Definition at line 310 of file scheduler-activity-test.cpp.

References Activity::activate(), ActivityMatch::arg(), Activity::dispatch(), ActivityDetector::incrementSeq(), Activity::next, and ActivityMatch::seq().

+ Here is the call graph for this function:

◆ termBuilder()

void termBuilder ( )
inlineprivate
Test:
verify the Activity term builder
  • use the builder syntax to define a simple Activity chain
  • verify the basic outfitting and sane connectivity
  • verify values reported by the BlockFlow allocator
  • ensure the defined Job can be properly invoked

Definition at line 371 of file scheduler-activity-test.cpp.

◆ dispatchChain()

void dispatchChain ( )
inlineprivate
Test:
verify the ability to dispatch and perform a chain of activities.
  • use a directly wired, arbitrary chain
  • dispatch will activate all Activities
  • however, when the Gate is configured to be blocked (waiting on prerequisites), then the rest of the chain is not activated.
  • the dispatch function also handles the notifications; when a notification towards the Gate is dispatched, the Gate is decremented and thereby opened; activation of the rest of the chain is then planned (but not executed synchronously in the same call)

Definition at line 424 of file scheduler-activity-test.cpp.

References ActivityMatch::arg(), ActivityLang::dispatchChain(), ActivityDetector::incrementSeq(), Activity::next, and ActivityMatch::seq().

+ Here is the call graph for this function:

◆ scenario_RenderJob()

void scenario_RenderJob ( )
inlineprivate
Test:
usage scenario: Activity graph for a simple render job
  • build an activity term based on the »CalculationJob« wiring template
  • dispatch the generated Activity chain and verify sequence of invocations

Definition at line 470 of file scheduler-activity-test.cpp.

References ActivityMatch::arg(), ActivityLang::dispatchChain(), and Activity::next.

+ Here is the call graph for this function:

◆ scenario_Notification()

void scenario_Notification ( )
inlineprivate
Test:
usage scenario: Notification from prerequisite Jobs within time window
  • build similar »CalculationJob« wiring
  • configure extended dependency notification capabilities
  • Case-1 : a Notification decreases the latch, but blocks otherwise
  • Case-2 : when the primary chain is activated after the Notification, then the tail chain behind the Gate is dispatched

Definition at line 514 of file scheduler-activity-test.cpp.

References ActivityMatch::arg(), ActivityLang::dispatchChain(), Activity::FEED, Activity::GATE, ActivityDetector::incrementSeq(), ActivityDetector::insertActivationTap(), Activity::INVOKE, Time::NEVER, Activity::next, Activity::NOTIFY, Activity::POST, ActivityMatch::seq(), Activity::WORKSTART, and Activity::WORKSTOP.

+ Here is the call graph for this function:

◆ scenario_IOJob()

void scenario_IOJob ( )
inlineprivate
Test:
usage scenario: Activity graph for an async Job
  • use a simple calculation job term as follow-up receiver
  • build an activity Term based on the »Async Load Job« wiring and link it to the receiver
  • also retrieve the Activity record used as re-entrance point after completing async IO

Definition at line 599 of file scheduler-activity-test.cpp.

References ActivityMatch::arg(), ActivityLang::dispatchChain(), Activity::FEED, Activity::GATE, ActivityDetector::incrementSeq(), Activity::INVOKE, Activity::next, Activity::NOTIFY, Activity::POST, ActivityMatch::seq(), Activity::WORKSTART, and Activity::WORKSTOP.

+ Here is the call graph for this function:

◆ scenario_MetaJob()

void scenario_MetaJob ( )
inlineprivate
Test:
usage scenario: Activity graph for administrative job
  • by default, neither Gate, nor start/stop notification used
  • rather, the INVOKE and the argument-FEED is posted directly
Remarks
the job itself is thus performed in »management mode« (holding the GroomingToken), and may modify the queue to generate new jobs.

Definition at line 669 of file scheduler-activity-test.cpp.

References ActivityMatch::arg(), ActivityLang::dispatchChain(), Activity::FEED, ActivityDetector::insertActivationTap(), Activity::INVOKE, Activity::next, and Activity::POST.

+ Here is the call graph for this function:
+ Inheritance diagram for SchedulerActivity_test:
+ Collaboration diagram for SchedulerActivity_test:

The documentation for this class was generated from the following file: