From 817bfd7517276690fdc16c2e5da8be8eba9e10e5 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Thu, 11 Feb 2016 23:50:37 -0500 Subject: [PATCH] When acting-pid is 'meta, take the entire delta as the delta-aggregate. This is correct because now that we have echo-cancelled SCNs, incoming SCNs from the metalevel are *always* new information for the contained actors. --- .../examples/example-meta-echo2.rkt | 14 ++++++++++++++ prospect/examples/example-meta-echo2.rkt | 14 ++++++++++++++ prospect/mux.rkt | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 prospect-monolithic/examples/example-meta-echo2.rkt create mode 100644 prospect/examples/example-meta-echo2.rkt diff --git a/prospect-monolithic/examples/example-meta-echo2.rkt b/prospect-monolithic/examples/example-meta-echo2.rkt new file mode 100644 index 0000000..ba4bfea --- /dev/null +++ b/prospect-monolithic/examples/example-meta-echo2.rkt @@ -0,0 +1,14 @@ +#lang prospect-monolithic +;; The actor should receive a single event adding the (at-meta x) assertion. + +(require prospect/pretty) + +(spawn-network + (spawn (lambda (e counter) + (and e + (let ((new-counter (+ counter 1))) + (printf "Received event ~a:\n~a\n" new-counter (prospect-pretty-print->string e)) + (transition (+ counter 1) '())))) + 0 + (list (scn/union (assertion (at-meta 'x)) + (subscription 'x #:meta-level 1))))) diff --git a/prospect/examples/example-meta-echo2.rkt b/prospect/examples/example-meta-echo2.rkt new file mode 100644 index 0000000..85d3e51 --- /dev/null +++ b/prospect/examples/example-meta-echo2.rkt @@ -0,0 +1,14 @@ +#lang prospect +;; The actor should receive a single event adding the (at-meta x) assertion. + +(require prospect/pretty) + +(spawn-network + (spawn (lambda (e counter) + (and e + (let ((new-counter (+ counter 1))) + (printf "Received event ~a:\n~a\n" new-counter (prospect-pretty-print->string e)) + (transition (+ counter 1) '())))) + 0 + (list (patch-seq (sub 'x #:meta-level 1) + (assert (at-meta 'x)))))) diff --git a/prospect/mux.rkt b/prospect/mux.rkt index e4ab608..499417d 100644 --- a/prospect/mux.rkt +++ b/prospect/mux.rkt @@ -81,7 +81,7 @@ (define (compute-patches old-m new-m label delta delta-aggregate) (define delta-aggregate/no-echo (if (meta-label? label) - delta-aggregate + delta (patch (trie-prune-branch (patch-added delta-aggregate) struct:at-meta) (trie-prune-branch (patch-removed delta-aggregate) struct:at-meta)))) (define old-routing-table (mux-routing-table old-m))