Update to use build-actions; fix clerk communication
[mudsync.git] / mudsync / networking.scm
index 230008fc76cb5c213e3057f8b6e9e6f2b4c370ae..c2c1068aedf8d3dbc50a61c56bca34b82e1377dd 100644 (file)
@@ -17,7 +17,7 @@
 ;;; along with Mudsync.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (mudsync networking)
-  #:use-module (8sync systems actors)
+  #:use-module (8sync actors)
   #:use-module (8sync agenda)
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
   ;; send input to this actor
   (send-input-to #:getter nm-send-input-to
                  #:init-keyword #:send-input-to)
-  (message-handler
+
+  (actions
+   #:allocation #:each-subclass
    #:init-value
-   (make-action-dispatch
-    ((start-listening actor message)
-     (nm-install-socket actor (message-ref message 'server %default-server)
-                        (message-ref message 'port %default-port)))
-    ((send-to-client actor message client data)
-     (nm-send-to-client-id actor client data)))))
+   (build-actions
+    (start-listening
+     (lambda* (actor message
+                     #:key (server %default-server)
+                     (port %default-port))
+       (nm-install-socket actor server port)))
+    (send-to-client
+     (lambda* (actor message #:key client data)
+       (nm-send-to-client-id actor client data))))))
 
 ;;; TODO: We should provide something like this, but this isn't used currently,
 ;;;    and uses old deprecated code (the 8sync-port-remove stuff).