2016-07-10 23:15:50 +00:00
|
|
|
#lang syndicate/actor
|
|
|
|
;; Demonstrates that fields at actor scope are visible to facets.
|
|
|
|
|
2017-02-15 23:18:19 +00:00
|
|
|
(spawn* (field [x 123])
|
2016-08-24 16:35:38 +00:00
|
|
|
(react
|
|
|
|
(on (message `(read-from ,$this-field))
|
|
|
|
(log-info "Trying to read from ~a" this-field)
|
|
|
|
(log-info "Read: ~a" (this-field))
|
|
|
|
(send! `(read-successfully ,this-field))))
|
|
|
|
(react
|
|
|
|
(on-start
|
|
|
|
(log-info "x in second facet: ~v (should be 123)" (x))
|
|
|
|
(send! `(read-from ,x))
|
|
|
|
(until (message `(read-successfully ,x)))
|
|
|
|
(log-info "Done."))))
|