aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2024-09-30 02:11:59 +0100
committerArun Isaac2024-10-01 01:12:51 +0100
commit08226a390ac206e4e8062cd0a30a96289c38dd27 (patch)
tree5e1a19526007e0b7175630fb74f4bb212bbbff40
parent0b7241bffd43ef3ce26734a020ca5dfe72dcc95a (diff)
downloadravanan-08226a390ac206e4e8062cd0a30a96289c38dd27.tar.gz
ravanan-08226a390ac206e4e8062cd0a30a96289c38dd27.tar.lz
ravanan-08226a390ac206e4e8062cd0a30a96289c38dd27.zip
propnet: Pass on scheduler to schedule calls.
This enables sub-propnets (or compound propagators) to share the same scheduler. * ravanan/propnet.scm (activate-propagator): Accept scheduler as argument instead of the schedule function. (poll-propnet): Pass scheduler as argument instead of its schedule function.
-rw-r--r--ravanan/propnet.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/ravanan/propnet.scm b/ravanan/propnet.scm
index 6110d93..f78e8e0 100644
--- a/ravanan/propnet.scm
+++ b/ravanan/propnet.scm
@@ -84,10 +84,10 @@ map @var{proc} over both the lists and return the resulting lists."
(values (map proc true-list)
(map proc false-list))))
-(define (activate-propagator schedule propagator inputs-alist)
+(define (activate-propagator scheduler propagator inputs-alist)
"Activate @var{propagator} with inputs from @var{inputs-alist}. If some
required inputs are absent, do nothing. Schedule the propagator using
-@var{schedule}."
+@var{scheduler}."
(match (lset-difference equal?
(map (match-lambda
((input-name . _) input-name))
@@ -96,7 +96,8 @@ required inputs are absent, do nothing. Schedule the propagator using
((input-name . _) input-name))
inputs-alist)
(propagator-optional-inputs propagator))
- (() (just (schedule (propagator-proc propagator) inputs-alist)))
+ (() (just ((scheduler-schedule scheduler)
+ (propagator-proc propagator) inputs-alist scheduler)))
(_ %nothing)))
(define (rassoc val alist)
@@ -215,7 +216,7 @@ add to the inbox."
(append (maybe-alist
(cons (propagator-name propagator)
(activate-propagator
- (scheduler-schedule scheduler)
+ scheduler
propagator
(propagator-input-values cells propagator))))
propagators-in-flight)))