2016-07-10 16:33:16 +00:00
|
|
|
#lang syndicate/actor
|
2016-07-09 21:25:37 +00:00
|
|
|
;; Demonstrates that fields may not be passed between actors.
|
|
|
|
|
2017-02-15 23:18:19 +00:00
|
|
|
(spawn #:name 'reading-actor
|
2016-08-24 16:35:38 +00:00
|
|
|
(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))))
|
2016-07-09 21:25:37 +00:00
|
|
|
|
2017-02-15 23:18:19 +00:00
|
|
|
(spawn #:name 'requesting-actor
|
2016-07-09 21:25:37 +00:00
|
|
|
(field [a 123])
|
2016-08-24 16:35:38 +00:00
|
|
|
(on-start (send! `(read-from ,a)))
|
|
|
|
(stop-when (message `(read-successfully ,a)))
|
|
|
|
(on-stop (log-info "Done.")))
|