2022-05-26 15:07:40 +00:00
|
|
|
#lang syndicate
|
|
|
|
;;; SPDX-License-Identifier: LGPL-3.0-or-later
|
2023-01-16 14:57:29 +00:00
|
|
|
;;; SPDX-FileCopyrightText: Copyright © 2022-2023 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
2022-05-26 15:07:40 +00:00
|
|
|
|
|
|
|
(require syndicate/distributed/ports)
|
|
|
|
|
|
|
|
(message-struct log (timestamp details))
|
|
|
|
|
|
|
|
(module+ main
|
|
|
|
(standard-actor-system/no-services (ds)
|
|
|
|
(spawn #:name 'main
|
|
|
|
(facet-prevent-inert-check! this-facet)
|
|
|
|
(run-port-relay
|
|
|
|
#:export
|
|
|
|
(ref (during* (lambda (a)
|
|
|
|
(eprintf "assert ~a\n" a)
|
|
|
|
(match (hash-ref a 'log #f)
|
|
|
|
[(embedded l)
|
|
|
|
(send! l (log "-" (hash 'line "hello!")))]
|
|
|
|
[_ (void)])
|
|
|
|
(on-stop (eprintf "retract ~a\n" a)))))))))
|