syndicate-2017/historical/syndicate-monolithic/examples/example-meta-echo2.rkt

15 lines
518 B
Racket
Raw Normal View History

2016-04-01 23:53:46 +00:00
#lang syndicate-monolithic
;; The actor should receive a single event adding the (at-meta x) assertion.
2016-04-01 23:53:46 +00:00
(require syndicate/pretty)
(spawn-dataspace
(spawn (lambda (e counter)
(and e
(let ((new-counter (+ counter 1)))
2016-04-01 23:53:46 +00:00
(printf "Received event ~a:\n~a\n" new-counter (syndicate-pretty-print->string e))
(transition (+ counter 1) '()))))
0
(list (scn/union (assertion (at-meta 'x))
(subscription 'x #:meta-level 1)))))