This is the simple-actors Reference Manual, version 1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:42:09 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
simple-actors
Actor model implemented with closures.
Jeremy Phelps
BSD
1
bordeaux-threads
(system).
actors.lisp
(file).
ipc.lisp
(file).
better-handler-case.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
simple-actors/simple-actors.asd
simple-actors/actors.lisp
simple-actors/ipc.lisp
simple-actors/better-handler-case.lisp
simple-actors/actors.lisp
ipc.lisp
(file).
better-handler-case.lisp
(file).
simple-actors
(system).
*current-channel*
(special variable).
actor
(macro).
actor
(class).
channel-receive
(function).
channel-send
(function).
defactor
(macro).
send
(generic function).
server
(macro).
*channel-role*
(special variable).
*default-channel-timeout*
(special variable).
looks-like-old-actor-form
(function).
server-interaction-repl
(function).
two-way-channel
(class).
simple-actors/ipc.lisp
simple-actors
(system).
get-message
(function).
make-mailbox
(function).
send-message
(function).
copy-simple-process-mailbox
(function).
mailbox-is-empty
(condition).
make-simple-process-mailbox
(function).
semaphore-timeout
(condition).
simple-process-mailbox
(structure).
simple-process-mailbox-blocker
(reader).
(setf simple-process-mailbox-blocker)
(writer).
simple-process-mailbox-lock
(reader).
(setf simple-process-mailbox-lock)
(writer).
simple-process-mailbox-p
(function).
simple-process-mailbox-read-messages
(reader).
(setf simple-process-mailbox-read-messages)
(writer).
simple-process-mailbox-unread-messages
(reader).
(setf simple-process-mailbox-unread-messages)
(writer).
without-mutex
(macro).
simple-actors/better-handler-case.lisp
simple-actors
(system).
handler-case*
(macro).
expand-handler-bind
(function).
expand-handler-case
(function).
mapapply
(function).
Packages are listed by definition order.
simple-actors/ipc
This package provides a basic method for threads to send messages to each other.
bordeaux-threads
.
common-lisp
.
get-message
(function).
make-mailbox
(function).
send-message
(function).
copy-simple-process-mailbox
(function).
mailbox-is-empty
(condition).
make-simple-process-mailbox
(function).
semaphore-timeout
(condition).
simple-process-mailbox
(structure).
simple-process-mailbox-blocker
(reader).
(setf simple-process-mailbox-blocker)
(writer).
simple-process-mailbox-lock
(reader).
(setf simple-process-mailbox-lock)
(writer).
simple-process-mailbox-p
(function).
simple-process-mailbox-read-messages
(reader).
(setf simple-process-mailbox-read-messages)
(writer).
simple-process-mailbox-unread-messages
(reader).
(setf simple-process-mailbox-unread-messages)
(writer).
without-mutex
(macro).
simple-actors
common-lisp
.
simple-actors/better-handler-case
.
simple-actors/ipc
.
*current-channel*
(special variable).
actor
(macro).
actor
(class).
channel-receive
(function).
channel-send
(function).
defactor
(macro).
send
(generic function).
server
(macro).
*channel-role*
(special variable).
*default-channel-timeout*
(special variable).
looks-like-old-actor-form
(function).
server-interaction-repl
(function).
two-way-channel
(class).
simple-actors/better-handler-case
handler-case*
common-lisp
.
handler-case*
(macro).
expand-handler-bind
(function).
expand-handler-case
(function).
mapapply
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Similar to LAMBDA, except the object created is an ACTOR instead of a FUNCTION. The ACTOR will wait
for messages and evaluate the BODY sequentially each time a message is received.
You can send messages to the actor with SEND. The &REST arguments to SEND must match the actor’s lambda-list
with one exception: A message consisting of the single argument ’SIMPLE-ACTORS:STOP will terminate the actor’s thread
immediately without attempting to bind the actor’s arguments or evaluate its BODY. However, the ’ACTORS:STOP
message cannot interrupt the BODY if it is being evaluated when the message is sent. ’SIMPLE-ACTORS:STOP is processed
when the actor begins waiting for a new message.
Within BODY, the variable SIMPLE-ACTORS:SELF is lexically bound to
the current actor.
The first form of the BODY is expected to be a plist. The :CLASS property of this plist can be used
to specify a class other than SIMPLE-ACTORS:ACTOR to use for the actor object. If the first form of the BODY doesn’t
look like a plist with property names specified by keywords, for backwards compatibility it will be
assumed to be an ordinary form, and will be included in the body of the message-handling function.
Like DEFUN but for actors. The resulting NAME is a variable whose value is an actor.
Like HANDLER-CASE and HANDLER-BIND rolled into one. Example usage:
(handler-case* (restart-case (error "ZOMG! ERROR!")
(fuck-it () ’ignored))
(t (condition)
:before-unwind
(progn (format t "An error occurred Ignore it (y/N)? ")
(if (eq (read) ’y)
(invoke-restart ’fuck-it)))
:after-unwind
(format t "You just couldn’t fucking ignore it, could you?~%")))
:before-unwind is, of course, executed before the stack unrolls, so you can
invoke restarts from there. If no restart is invoked, the error falls through
to the :after-unwind case, where you can handle it like a regular handler-case.
If no :after-unwind form is provided and no restart is invoked, the condition is not trapped.
Spawns a thread that you can interact with through a TWO-WAY-CHANNEL.
In the new thread, that channel will be bound to the VAR (and also to SIMPLE-ACTORS:*CURRENT-CHANNEL*) and then the BODY
will be evaluated. The thread terminates when the BODY completes.
The SERVER form returns two values: The two-way-channel through which you may communicate
interactively with the server, and the thread object.
Sends a message through a two-way-channel. The actors on either end of a two-way-channel play two roles on this channel: Either :CLIENT or :SERVER.
Reads a message from the given MAILBOX object. By default, if there are no messages,
GET-MESSAGE will block until a message arrives in the MAILBOX.
Keys:
:NON-BLOCKING If set to T, then GET-MESSAGE will return immediately even if there are no messages.
:DEFAULT-VALUE In non-blocking mode, this is the default return value if there are no messages.
:ERROR-IF-EMPTY If set to T :NON-BLOCKING is also T, and there are no messages, a condition of type
’MAILBOX-IS-EMPTY will be signalled.
See also: SEND-MESSAGE, MAILBOX
Sends a MESSAGE to the specified MAILBOX. The MESSAGE can be any Lisp value. If
the mailbox does not exist, it will be created.
See also: GET-MESSAGE
Helper for the HANDLER-CASE* macro. This one creates the HANDLER-BIND lambdas out of the :BEFORE-UNWIND form.
Helper for the HANDLER-CASE* macro. This one creates the HANDLER-CASE handler-clauses out of the :AFTER-UNWIND form
Maps over a list, treating each element in the list as an argument list for FUNC.
lock
.
condition
.
simple-error
.
structure-object
.
bordeaux-threads
.
bordeaux-threads:lock
(bordeaux-threads:make-lock)
bordeaux-threads:semaphore
(bordeaux-threads:make-semaphore)
list
list
Jump to: | (
A C D E F G H L M S W |
---|
Jump to: | (
A C D E F G H L M S W |
---|
Jump to: | *
B I L M O R S U |
---|
Jump to: | *
B I L M O R S U |
---|
Jump to: | A B C F I M P S T |
---|
Jump to: | A B C F I M P S T |
---|