;; Maybe the wrong place for this, or for it to be exported.
;; But it's used in websockets' server implementation at least...
- live-wrap))
+ live-wrap
+
+ *debug-actor-ids*))
;; For ids
(set! *random-state* (random-state-from-platform))
;; return the address
address))
+;;; Whether or not to attach the class' name as a cookie by default in
+;;; create-actor
+(define *debug-actor-ids*
+ (make-parameter #t))
+
(define* (create-actor actor-class #:rest init-args)
"Create an instance of actor-class. Return the new actor's id.
This is the method actors should call directly (unless they want
to supply an id-cookie, in which case they should use
create-actor*)."
- (%create-actor actor-class init-args #f #t))
-
+ (%create-actor actor-class init-args
+ (if (*debug-actor-ids*)
+ (symbol->string (class-name actor-class))
+ #f)
+ #t))
(define* (create-actor* actor-class id-cookie #:rest init-args)
"Create an instance of actor-class. Return the new actor's id.
Like create-actor, but permits supplying an id-cookie."
(%create-actor actor-class init-args id-cookie #t))
-(define* (self-destruct actor #:key (cleanup #t))
+(define (self-destruct actor)
"Remove an actor from the hive.
-Unless #:cleanup is set to #f, this will first have the actor handle
-its '*cleanup* action handler."
+The actor will also call its `actor-cleanup!' method."
(signal-condition! (address-dead? (actor-id actor)))
(put-message (*hive-channel*) (list 'remove-actor (actor-id-actor actor)))
;; Set *actor-prompt* to nothing to prevent actor-cleanup! from sending