From b3b6f7524c8a83b87dc7347d9cffbc00eeefb4f6 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 2 Sep 2023 22:36:02 +0200 Subject: [PATCH] Activity-Lang: outline for wiring async IO activities ...relies on the same building pattern, with the notable difference that the chain is severed, providing an additional NOTIFY as re-entrance point --- src/vault/gear/activity-lang.hpp | 9 +++++ src/vault/gear/activity-term.hpp | 12 ++++++ tests/vault/gear/scheduler-activity-test.cpp | 34 ++++++++++++++++- wiki/thinkPad.ichthyo.mm | 40 +++++++++++++++++++- 4 files changed, 91 insertions(+), 4 deletions(-) diff --git a/src/vault/gear/activity-lang.hpp b/src/vault/gear/activity-lang.hpp index f98864c80..181ca0c23 100644 --- a/src/vault/gear/activity-lang.hpp +++ b/src/vault/gear/activity-lang.hpp @@ -86,6 +86,15 @@ namespace gear { return setupActivityScheme (activity::Term::CALC_JOB, job, start, deadline); } + /** + * Builder-API: initiate definition of IO data loading activities. + */ + activity::Term + buildAsyncLoadJob (Job job, Time start, Time deadline) + { + return setupActivityScheme (activity::Term::LOAD_JOB, job, start, deadline); + } + /** * Builder-API: initiate definition of internal/planning job. */ diff --git a/src/vault/gear/activity-term.hpp b/src/vault/gear/activity-term.hpp index acdda11fd..5161ac687 100644 --- a/src/vault/gear/activity-term.hpp +++ b/src/vault/gear/activity-term.hpp @@ -87,6 +87,7 @@ namespace gear { Activity* post_{nullptr}; Activity* gate_{nullptr}; + Activity* callback_{nullptr}; public: @@ -126,6 +127,17 @@ namespace gear { return *post_; } + /** + * @return re-entrance point for completion after async IO. + * @remark initiate follow-up processing by ActivityLang::dispatchChain(). + */ + Activity& + callback() + { + REQUIRE (callback_, "Activity Term properly configured for async IO"); + return *callback_; + } + /** * Builder operation: block this Term waiting for prerequisite notification. * @param notificationSrc an `NOTIFY`-Activity to attach the notification-link diff --git a/tests/vault/gear/scheduler-activity-test.cpp b/tests/vault/gear/scheduler-activity-test.cpp index 6b4c2b467..1aab8eeb8 100644 --- a/tests/vault/gear/scheduler-activity-test.cpp +++ b/tests/vault/gear/scheduler-activity-test.cpp @@ -457,7 +457,7 @@ namespace test { /** @test usage scenario: Activity graph for a simple render job - * - build a activity term based on the »CalculationJob« wiring template + * - build an activity term based on the »CalculationJob« wiring template * - dispatch the generated Activity chain and verify sequence of invocations */ void @@ -581,16 +581,46 @@ namespace test { .arg("<0, until -85401592:56:01.825")); // ... but the Gate has been closed permanently (by setting the deadline to Time::MIN) CHECK (detector.ensureNoInvocation("testJob") // ==> no further invocation .afterInvocation("trigger").seq(2)); + +// cout << detector.showLog()< - - + + + + + + @@ -80276,6 +80280,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + @@ -82804,6 +82811,35 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + +

+ und zwar »point and shot« — es muß genau die Implementierungs-Framenummer sein, die dann für die Verarbeitung wirklich gebraucht wird (und welche ist das?? ... wer weiß das???) +

+ +
+ +
+ + + + +

+ da hinter der Invocation stets ein JobFunctor steht, der über eine Closure Zugriff auf konkrete Kontext-Informationen hat — das einzige Prinzip in der für Lumiera entwickelten offenen Daten-Architektur ist, daß alles zu Berechnende zeitlich eingeordnet werden kann. Damit sollte jedwede Aktivität anhand der Zeitangabe im Stande sein, ihre konkrete Parametrisierung abzuleiten. Das Wichtige dabei: diese Ableitung bleibt ein lokales Detail. Der Planungs-Prozeß muß es überhaupt nicht wissen +

+ +
+
+ + + + +