2016-04-01 23:53:46 +00:00
|
|
|
#lang syndicate
|
2016-02-03 04:01:08 +00:00
|
|
|
;; Demonstrate almost-wildcard assertions.
|
2016-07-30 17:02:07 +00:00
|
|
|
;; One actor subscribes to everything except inbound assertions - and so initially sees itself.
|
|
|
|
;; The other advertises everything except subscriptions and inbound/outbound assertions.
|
2016-04-07 07:42:54 +00:00
|
|
|
;; The first actor's aggregate view of the dataspace then includes everything
|
2016-07-30 17:02:07 +00:00
|
|
|
;; except inbound assertions.
|
2016-02-03 04:01:08 +00:00
|
|
|
|
2016-04-01 23:53:46 +00:00
|
|
|
(require syndicate/pretty)
|
2016-02-03 04:01:08 +00:00
|
|
|
|
2017-02-15 23:18:19 +00:00
|
|
|
(actor (lambda (e s)
|
2016-02-03 04:01:08 +00:00
|
|
|
(printf "Subscriber - Aggregate\n")
|
2016-04-01 23:53:46 +00:00
|
|
|
(syndicate-pretty-print s)
|
2016-02-03 04:01:08 +00:00
|
|
|
(printf "Subscriber - Patch\n")
|
2016-04-01 23:53:46 +00:00
|
|
|
(syndicate-pretty-print e)
|
2016-02-03 04:01:08 +00:00
|
|
|
(newline)
|
|
|
|
(if (patch? e)
|
|
|
|
(transition (update-interests s e) '())
|
|
|
|
#f))
|
2016-03-12 16:54:31 +00:00
|
|
|
trie-empty
|
2016-07-30 17:02:07 +00:00
|
|
|
(patch-seq (sub ?)
|
|
|
|
(unsub (inbound ?))))
|
2016-02-03 04:01:08 +00:00
|
|
|
|
2017-02-15 23:18:19 +00:00
|
|
|
(actor (lambda (e s)
|
2016-02-03 04:01:08 +00:00
|
|
|
(printf "Asserter\n")
|
2016-04-01 23:53:46 +00:00
|
|
|
(syndicate-pretty-print e)
|
2016-02-03 04:01:08 +00:00
|
|
|
(newline)
|
|
|
|
#f)
|
|
|
|
(void)
|
|
|
|
(patch-seq (assert ?)
|
|
|
|
(retract (observe ?))
|
2016-07-30 17:02:07 +00:00
|
|
|
(retract (outbound ?))
|
|
|
|
(retract (inbound ?))))
|