1 ;;; 8sync --- Asynchronous programming for Guile
2 ;;; Copyright (C) 2016 Christopher Allan Webber <cwebber@dustycloud.org>
4 ;;; This file is part of 8sync.
6 ;;; 8sync is free software: you can redistribute it and/or modify it
7 ;;; under the terms of the GNU Lesser General Public License as
8 ;;; published by the Free Software Foundation, either version 3 of the
9 ;;; License, or (at your option) any later version.
11 ;;; 8sync is distributed in the hope that it will be useful,
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU Lesser General Public License for more details.
16 ;;; You should have received a copy of the GNU Lesser General Public
17 ;;; License along with 8sync. If not, see <http://www.gnu.org/licenses/>.
19 (use-modules (8sync actors)
22 (define-simple-actor <emo>
24 (lambda (actor message target)
25 (display "emo> What's next, Proog?\n")
26 (<- actor target 'greet-emo))))
28 (define-simple-actor <proog>
30 (lambda (actor message)
31 (display "proog> Listen, Emo! Listen to the sounds of the machine!\n"))))
33 (define hive (make-hive))
34 (define our-emo (hive-create-actor hive <emo>))
35 (define our-proog (hive-create-actor hive <proog>))
38 (list (bootstrap-message hive our-emo 'greet-proog