From e0e7baed46380c2af515d30a6612332547dcc487 Mon Sep 17 00:00:00 2001 From: Sam Caldwell Date: Wed, 8 Mar 2017 17:59:55 -0500 Subject: [PATCH] Keep ground dataspace running while subscriptions are present --- racket/syndicate/ground.rkt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/racket/syndicate/ground.rkt b/racket/syndicate/ground.rkt index 0f67055..ca8fcbe 100644 --- a/racket/syndicate/ground.rkt +++ b/racket/syndicate/ground.rkt @@ -12,6 +12,7 @@ (require "trace/stderr.rkt") (require "tset.rkt") (require "protocol/standard-relay.rkt") +(require "trie.rkt") (provide (struct-out external-event) current-ground-event-async-channel @@ -107,7 +108,10 @@ ;; background-activity-count ;; (trie->pretty-string interests)) (define active-events (extract-active-events interests)) - (if (and inert? (zero? background-activity-count) (null? active-events)) + ;; use the presence of subscriptions to indicate whether the program is + ;; waiting on a driver + (define ground-subscriptions (trie-step interests observe-parenthesis)) + (if (and inert? (zero? background-activity-count) (trie-empty? ground-subscriptions)) (begin (log-syndicate/ground-debug "run-ground: Terminating because inert") interests) (match (apply sync