From: Christopher Allan Webber Date: Mon, 2 Jan 2017 21:15:29 +0000 (-0600) Subject: actors: Automatically add cookie by default in hive-create-actor. X-Git-Tag: v0.4.0~32 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=c98c1f91b9b408972f9728f63988fbb25c0ec416;p=8sync.git actors: Automatically add cookie by default in hive-create-actor. Also switch separator in cookie from "-" to ":". * 8sync/actors.scm (hive-gen-actor-id): Switch separator from "-" to ":". (hive-create-actor): Automatically add a cookie based on the class name. (hive-create-actor*): Tweak docstring. --- diff --git a/8sync/actors.scm b/8sync/actors.scm index 1dab9d7..9a0bb30 100644 --- a/8sync/actors.scm +++ b/8sync/actors.scm @@ -440,7 +440,7 @@ to come after class definition." (define-method (hive-gen-actor-id (hive ) cookie) (make-address (if cookie - (string-append cookie "-" (big-random-number-string)) + (string-append cookie ":" (big-random-number-string)) (big-random-number-string)) (hive-id hive))) @@ -647,11 +647,13 @@ that method for documentation." actor-id)) (define* (hive-create-actor hive actor-class #:rest init) + "Create an actor on HIVE using ACTOR-CLASS passing in INIT args" (%hive-create-actor hive actor-class - init #f)) + init (symbol->string (class-name actor-class)))) (define* (hive-create-actor* hive actor-class id-cookie #:rest init) - "Create an actor, but also add a 'cookie' to the name for debugging" + "Create an actor, but also allow customizing a 'cookie' added to the id +for debugging" (%hive-create-actor hive actor-class init id-cookie))