This is the deeds Reference Manual, version 1.1.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:57:23 2024 GMT+0.
deeds/deeds.asd
deeds/package.lisp
deeds/class-slots.lisp
deeds/toolkit.lisp
deeds/origin.lisp
deeds/forward-class-definitions.lisp
deeds/event-class.lisp
deeds/event.lisp
deeds/standard-events.lisp
deeds/event-delivery.lisp
deeds/event-loop.lisp
deeds/handler.lisp
deeds/command.lisp
deeds/documentation.lisp
The main system appears first, followed by any subsystem dependency.
deeds
Deeds Extensible Event Delivery System
Yukari Hafner <shinmera@tymoon.eu>
Yukari Hafner <shinmera@tymoon.eu>
(GIT https://github.com/Shinmera/deeds.git)
zlib
1.1.1
closer-mop
(system).
bordeaux-threads
(system).
lambda-fiddle
(system).
form-fiddle
(system).
package.lisp
(file).
class-slots.lisp
(file).
toolkit.lisp
(file).
origin.lisp
(file).
forward-class-definitions.lisp
(file).
event-class.lisp
(file).
event.lisp
(file).
standard-events.lisp
(file).
event-delivery.lisp
(file).
event-loop.lisp
(file).
handler.lisp
(file).
command.lisp
(file).
documentation.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
deeds/deeds.asd
deeds/package.lisp
deeds/class-slots.lisp
deeds/toolkit.lisp
deeds/origin.lisp
deeds/forward-class-definitions.lisp
deeds/event-class.lisp
deeds/event.lisp
deeds/standard-events.lisp
deeds/event-delivery.lisp
deeds/event-loop.lisp
deeds/handler.lisp
deeds/command.lisp
deeds/documentation.lisp
deeds/class-slots.lisp
package.lisp
(file).
deeds
(system).
cached-slots-class
(class).
class-all-direct-slots
(method).
class-all-direct-slots
(method).
class-all-direct-slots
(reader method).
(setf class-all-direct-slots)
(writer method).
compute-all-direct-slots
(function).
define-cached-slots-class
(macro).
initialize-instance
(method).
reinitialize-instance
(method).
validate-superclass
(method).
validate-superclass
(method).
validate-superclass
(method).
validate-superclass
(method).
deeds/toolkit.lisp
class-slots.lisp
(file).
deeds
(system).
with-fuzzy-slot-bindings
(macro).
build-fuzzy-slot-accessor
(function).
compile-lambda
(function).
copy-hash-table
(function).
ensure-list
(function).
find-class-slot-for-compound
(function).
find-class-slot-fuzzy
(function).
find-slot-accessor
(function).
format-time
(function).
make-thread
(function).
removef
(function).
unlist
(function).
deeds/origin.lisp
toolkit.lisp
(file).
deeds
(system).
*origin*
(special variable).
here
(macro).
with-origin
(macro).
deeds/forward-class-definitions.lisp
origin.lisp
(file).
deeds
(system).
event-condition
(condition).
event-condition-event
(reader method).
(setf event-condition-event)
(writer method).
event-condition-slot
(reader method).
event-condition-slot
(reader method).
(setf event-condition-slot)
(writer method).
(setf event-condition-slot)
(writer method).
event-condition-value
(reader method).
(setf event-condition-value)
(writer method).
event-condition-writers
(reader method).
(setf event-condition-writers)
(writer method).
event-loop-condition
(condition).
event-loop-condition-event-loop
(reader method).
(setf event-loop-condition-event-loop)
(writer method).
event-loop-condition-handler
(reader method).
(setf event-loop-condition-handler)
(writer method).
event-loop-handler-dependency-cycle-error
(condition).
handler-condition
(condition).
handler-condition-handler
(reader method).
(setf handler-condition-handler)
(writer method).
handler-condition-thread
(reader method).
(setf handler-condition-thread)
(writer method).
handler-thread-stop-failed-warning
(condition).
immutable-event-slot-has-writer
(condition).
immutable-event-slot-modified
(condition).
deeds/event-class.lisp
forward-class-definitions.lisp
(file).
deeds
(system).
compute-effective-slot-definition
(method).
direct-slot-definition-class
(method).
effective-slot-definition-class
(method).
event-class
(class).
event-direct-slot-definition
(class).
event-effective-slot-definition
(class).
event-slot
(class).
event-slot-mutable
(reader method).
(setf event-slot-mutable)
(writer method).
initialize-instance
(method).
reinitialize-instance
(method).
(setf slot-value-using-class)
(method).
validate-superclass
(method).
validate-superclass
(method).
validate-superclass
(method).
validate-superclass
(method).
with-immutable-slots-unlocked
(macro).
check-event-slots
(function).
deeds/event.lisp
event-class.lisp
(file).
deeds
(system).
cancel
(generic function).
cancelled
(reader method).
(setf cancelled)
(writer method).
define-event
(macro).
event
(class).
event-loop
(reader method).
initialize-instance
(method).
issue-time
(reader method).
(setf issue-time)
(writer method).
origin
(reader method).
print-object
(method).
deeds/standard-events.lisp
event.lisp
(file).
deeds
(system).
blocking-event
(class).
chunked-payload-event
(class).
error-event
(class).
identified-event
(class).
identifier
(reader method).
index
(reader method).
info-event
(class).
initialize-instance
(method).
max-index
(reader method).
message
(reader method).
message-event
(class).
payload
(reader method).
payload-event
(class).
sequence-event
(class).
stream-begin-event
(class).
stream-end-event
(class).
stream-event
(class).
stream-payload-event
(class).
warning-event
(class).
done
(reader method).
(setf done)
(writer method).
deeds/event-delivery.lisp
standard-events.lisp
(file).
deeds
(system).
delivery-function
(reader method).
(setf delivery-function)
(writer method).
event-delivery
(class).
handle
(generic function).
issue
(generic function).
print-object
(method).
queued-event-delivery
(class).
running
(method).
running
(method).
running
(method).
start
(generic function).
stop
(generic function).
%stop
(class).
back-queue
(reader method).
(setf back-queue)
(writer method).
front-queue
(reader method).
(setf front-queue)
(writer method).
process-delivery-queue
(method).
queue-condition
(reader method).
queue-lock
(reader method).
queue-thread
(reader method).
(setf queue-thread)
(writer method).
deeds/event-loop.lisp
event-delivery.lisp
(file).
deeds
(system).
*standard-event-loop*
(special variable).
broadcast
(function).
build-event-loop
(generic function).
compiled-event-loop
(class).
deliver-event-directly
(generic function).
deregister-handler
(generic function).
do-issue
(macro).
ensure-handlers-sorted
(generic function).
event-loop
(class).
event-loop-lock
(reader method).
(setf event-loop-lock)
(writer method).
handle
(method).
handle
(method).
handler
(generic function).
(setf handler)
(generic function).
handlers
(reader method).
(setf handlers)
(writer method).
initialize-instance
(method).
issue
(method).
recompile-event-loop
(generic function).
register-handler
(generic function).
sort-handlers
(generic function).
sorted-event-loop
(class).
sorted-handlers
(reader method).
(setf sorted-handlers)
(writer method).
test-filter
(function).
compile-test
(function).
extract-tests
(function).
filter-tests
(function).
replace-tests
(function).
test-gensym
(function).
deeds/handler.lisp
event-loop.lisp
(file).
deeds
(system).
after
(reader method).
before
(reader method).
condition-notify-handler
(class).
define-handler
(macro).
event-type
(reader method).
filter
(reader method).
globally-blocking-handler
(class).
handle
(method).
handle
(method).
handle
(method).
handle
(method).
handle-cancelled
(reader method).
handler
(class).
handler-lock
(reader method).
handler-lock
(reader method).
(setf handler-lock)
(writer method).
(setf handler-lock)
(writer method).
issue
(method).
issue
(method).
locally-blocking-handler
(class).
loops
(reader method).
(setf loops)
(writer method).
make-handler
(function).
name
(reader method).
one-time-handler
(class).
parallel-handler
(class).
print-object
(method).
print-object
(method).
queued-handler
(class).
response-event
(reader method).
(setf response-event)
(writer method).
stop
(method).
threads
(reader method).
(setf threads)
(writer method).
with-awaiting
(macro).
with-handler
(macro).
with-one-time-handler
(macro).
with-response
(macro).
condition-variable
(reader method).
(setf condition-variable)
(writer method).
issue-synchronizer-lock
(reader method).
(setf issue-synchronizer-lock)
(writer method).
deeds/command.lisp
handler.lisp
(file).
deeds
(system).
command-event
(class).
define-command
(macro).
deeds/documentation.lisp
command.lisp
(file).
deeds
(system).
Packages are listed by definition order.
deeds
org.shirakumo.deeds
common-lisp
.
*origin*
(special variable).
*standard-event-loop*
(special variable).
after
(generic reader).
before
(generic reader).
blocking-event
(class).
broadcast
(function).
build-event-loop
(generic function).
cached-slots-class
(class).
cancel
(generic function).
cancelled
(generic reader).
(setf cancelled)
(generic writer).
chunked-payload-event
(class).
class-all-direct-slots
(generic function).
(setf class-all-direct-slots)
(generic writer).
command-event
(class).
compiled-event-loop
(class).
compute-all-direct-slots
(function).
condition-notify-handler
(class).
define-cached-slots-class
(macro).
define-command
(macro).
define-event
(macro).
define-handler
(macro).
deliver-event-directly
(generic function).
delivery-function
(generic reader).
(setf delivery-function)
(generic writer).
deregister-handler
(generic function).
do-issue
(macro).
ensure-handlers-sorted
(generic function).
error-event
(class).
event
(class).
event-class
(class).
event-condition
(condition).
event-condition-event
(generic reader).
(setf event-condition-event)
(generic writer).
event-condition-slot
(generic reader).
(setf event-condition-slot)
(generic writer).
event-condition-value
(generic reader).
(setf event-condition-value)
(generic writer).
event-condition-writers
(generic reader).
(setf event-condition-writers)
(generic writer).
event-delivery
(class).
event-direct-slot-definition
(class).
event-effective-slot-definition
(class).
event-loop
(generic reader).
event-loop
(class).
event-loop-condition
(condition).
event-loop-condition-event-loop
(generic reader).
(setf event-loop-condition-event-loop)
(generic writer).
event-loop-condition-handler
(generic reader).
(setf event-loop-condition-handler)
(generic writer).
event-loop-handler-dependency-cycle-error
(condition).
event-loop-lock
(generic reader).
(setf event-loop-lock)
(generic writer).
event-slot
(class).
event-slot-mutable
(generic reader).
(setf event-slot-mutable)
(generic writer).
event-type
(generic reader).
filter
(generic reader).
globally-blocking-handler
(class).
handle
(generic function).
handle-cancelled
(generic reader).
handler
(generic function).
(setf handler)
(generic function).
handler
(class).
handler-condition
(condition).
handler-condition-handler
(generic reader).
(setf handler-condition-handler)
(generic writer).
handler-condition-thread
(generic reader).
(setf handler-condition-thread)
(generic writer).
handler-lock
(generic reader).
(setf handler-lock)
(generic writer).
handler-thread-stop-failed-warning
(condition).
handlers
(generic reader).
(setf handlers)
(generic writer).
here
(macro).
identified-event
(class).
identifier
(generic reader).
immutable-event-slot-has-writer
(condition).
immutable-event-slot-modified
(condition).
index
(generic reader).
info-event
(class).
issue
(generic function).
issue-time
(generic reader).
(setf issue-time)
(generic writer).
locally-blocking-handler
(class).
loops
(generic reader).
(setf loops)
(generic writer).
make-handler
(function).
max-index
(generic reader).
message
(generic reader).
message-event
(class).
name
(generic reader).
one-time-handler
(class).
origin
(generic reader).
parallel-handler
(class).
payload
(generic reader).
payload-event
(class).
queued-event-delivery
(class).
queued-handler
(class).
recompile-event-loop
(generic function).
register-handler
(generic function).
response-event
(generic reader).
(setf response-event)
(generic writer).
running
(generic function).
sequence-event
(class).
sort-handlers
(generic function).
sorted-event-loop
(class).
sorted-handlers
(generic reader).
(setf sorted-handlers)
(generic writer).
start
(generic function).
stop
(generic function).
stream-begin-event
(class).
stream-end-event
(class).
stream-event
(class).
stream-payload-event
(class).
test-filter
(function).
threads
(generic reader).
(setf threads)
(generic writer).
warning-event
(class).
with-awaiting
(macro).
with-fuzzy-slot-bindings
(macro).
with-handler
(macro).
with-immutable-slots-unlocked
(macro).
with-one-time-handler
(macro).
with-origin
(macro).
with-response
(macro).
%stop
(class).
back-queue
(generic reader).
(setf back-queue)
(generic writer).
build-fuzzy-slot-accessor
(function).
check-event-slots
(function).
checkdocs
(function).
compile-lambda
(function).
compile-test
(function).
condition-variable
(generic reader).
(setf condition-variable)
(generic writer).
copy-hash-table
(function).
done
(generic reader).
(setf done)
(generic writer).
ensure-list
(function).
extract-tests
(function).
filter-tests
(function).
find-class-slot-for-compound
(function).
find-class-slot-fuzzy
(function).
find-slot-accessor
(function).
format-time
(function).
front-queue
(generic reader).
(setf front-queue)
(generic writer).
issue-synchronizer-lock
(generic reader).
(setf issue-synchronizer-lock)
(generic writer).
make-thread
(function).
process-delivery-queue
(generic function).
queue-condition
(generic reader).
queue-lock
(generic reader).
queue-thread
(generic reader).
(setf queue-thread)
(generic writer).
removef
(function).
replace-tests
(function).
setdocs
(macro).
test-gensym
(function).
unlist
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
The variable designating the current origin.
The value of this might not be useful or significant for anything,
but if at all possible it should denote some kind of identifier for
the place where an event was signalled from.
See WITH-ORIGIN
The default global instance of a compiled-event-loop.
Shorthand macro around defclass to define a cached-slots-class.
All this does is wrap the defclass in an EVAL-WHEN and add the
metaclass option for cached-slots-class.
See CACHED-SLOTS-CLASS
Define a command.
This is a combinging macro that does three things:
. Define an event of NAME with the necessary fields from ARGS.
. Define a function of NAME with the given ARGS that issues
an instance of this newly defined event.
. Define a handler of NAME on the NAME event with the given
OPTIONS-AND-BODY.
A new option is available just for this macro with the name
:SUPERCLASSES, which allows you to specify the direct-superclasses
to use in the event definition.
The first argument in ARGS must be the name for the event as
required by DEFINE-HANDLER. The rest are arguments to the function
and simultaneously slots on the event class. In order to allow you
to specify slot options, arguments have the following structure:
ARGS ::= SINGLE* [&optional DEFAULTING*] [&rest SINGLE*] [&key DEFAULTING*]
SINGLE ::= symbol | (symbol SLOT-ARG*)
DEFAULTING ::= symbol | (symbol value SLOT-ARG*)
SLOT-ARG ::= keyword value
The purpose of defining commands is to allow something akin to a
function definition that can be treated as such for most purposes
while still integrating it with the event system and allowing
extension through that.
Shorthand convenience macro around DEFCLASS to define new event classes.
Pushes the EVENT-CLASS as :METACLASS and EVENT as direct-superclass if it does not already appear somewhere as a transitive superclass.
Define and register a new event handler on a particular event loop.
This simply expands to a WITH-HANDLER form with a few extra options
to make things easier. Most notably, NAME is transformed (quoted) into
the :NAME option. If the :SELF option is given, it names the symbol
to which the instance of the handler itself is bound, from which it is
accessible from within the handler body.
See WITH-HANDLER
Shorthand macro to allow more convenient issuing of events.
Supports one extra keyword argument that will not be passed along to the MAKE-INSTANCE call: LOOP will instead denote the event-loop to which the event is issued, defaulting to *STANDARD-EVENT-LOOP*.
See *STANDARD-EVENT-LOOP*
A macro that tries to figure out the most appropriate identifier for where this is.
Establishes a binding context similar to WITH-SLOTS and WITH-ACCESSORS but using the most appropriate way to access a slot, and a fuzzy manner of identifying slots.
Each VAR can either be a list of NAME SLOT-ISH, or simply the SLOT-ISH which will be used as the name as well.
You must pass the class explicitly since we have to be able to analyse the slots of the class during compile time.
See BUILD-FUZZY-SLOT-ACCESSOR
Convenient macro to construct a handler.
ARGS must be a list of at least one value, which must be a symbol that is
bound to the event instance. The rest of the args are slots of the event,
bound by WITH-FUZZY-SLOT-BINDINGS. Note that as per the limitation on
event-type specifiers arising from FIND-CLASS-SLOT-FOR-COMPOUND, only
direct class-name types or compound types consisting of OR and AND are
possible for the EVENT-TYPE.
The actual body forms are composed into a lambda form which is passed
as the :DELIVERY-FUNCTION argument to MAKE-HANDLER alongside with
EVENT-TYPE. It is also wrapped in a WITH-ORIGIN environment where the
origin is set to the :NAME option.
See MAKE-HANDLER
See WITH-FUZZY-SLOT-BINDINGS
See WITH-ORIGIN
Unlocks immutable slots, allowing you to modify them.
This simply automatically calls the CONTINUE restart when an error of type
IMMUTABLE-EVENT-SLOT-MODIFIED is signalled.
See EVENT-SLOT
Constructs a handler that can only handle a single event before being deregistered again.
Defaults the class to ONE-TIME-HANDLER.
See WITH-HANDLER
See ONE-TIME-HANDLER
See DEREGISTER-HANDLER
Binds *ORIGIN* to a new value, which is by default figured out by HERE.
See *ORIGIN*
See HERE
A macro to de-asynchronise waiting for a response to an event.
More specifically, this construct allows you to circumvent having to use callbacks and instead allows the handling of an event that is in response to an issued one in the same thread as if it all happened sequentially.
ISSUE ::= event-type | (event-type initarg*)
RESPONSE ::= event-type | (event-type [event-symbol slots*])
In detail the following happens when the block generated by this macro
is executed:
. A handler is instantiated with the given response event-type and filter.
. The handler is started up.
. The handler’s synchronizer lock is acquired.
. The handler is registered on the given event-loop.
. An event is issued with the event-type and initargs onto the event-loop.
. Now the thread waits on the handler’s condition variable.
. Once the thread is reawakened before the timeout it binds the event
from the handler and the specified slot variables, then proceeds to
evaluate the body.
. As a cleanup, the handler is deregistered and stopped.
The handler itself performs the following steps once it HANDLEs an event:
. Acquire the one-time-handler exclusive lock.
. Save the event on its own slot.
. Acquire the synchronizer lock and immediately release it again to ensure
that the issuing thread is waiting on the condition variable.
. Notify the condition variable.
See DO-ISSUE
See REGISTER-HANDLER
See DEREGISTER-HANDLER
See WITH-FUZZY-SLOT-BINDINGS
See CONDITION-NOTIFY-HANDLER
Shorthand function to allow issuing of an event to multiple loops.
Supports an extra keyword argument that will not be passed along
to the MAKE-INSTANCE call: LOOP will instead denote the event-loop/s
to which one instance each will be issued, defaulting to
*STANDARD-EVENT-LOOP*.
See *STANDARD-EVENT-LOOP*
Computes all direct slots of the given class, including those of its superclasses.
This simply traverses the class hierarchy upwards, gathering all
direct-slots instances along the way. If one class along the way
is a CACHED-SLOTS-CLASS, the CLASS-ALL-DIRECT-SLOTS value is used
directly instead of traversing further. This does not apply for
the passed class.
See CACHED-SLOTS-CLASS
Creates a new handler instance and takes care of registering it.
Creating a new handler this way will simply construct the handler object,
start it, and register it on the event loop. If a handler with the same
name already exists on the event loop, this old handler is stopped and
replaced by the new one.
Only the :LOOP and :CLASS options are not passed along to the
make-instance call, as they are used by make-handler itself.
See HANDLER
See REGISTER-HANDLER
See QUEUED-HANDLER
See *STANDARD-EVENT-LOOP*
See WITH-HANDLER
See DEFINE-HANDLER
See WITH-ONE-TIME-HANDLER
Test the filter against the event.
Note that you must test whether the event is of applicable type as
required by the test yourself, since the test form does not contain
this information in itself.
The structure of a filter is as follows:
FILTER ::= COMBINATOR | TEST
COMBINATOR ::= (AND TEST*) | (OR TEST*) | (NOT TEST)
TEST ::= (function ARGUMENT*)
ARGUMENT ::= fuzzy-slot-symbol | atom
fuzzy-slot-symbols denote the value of a slot on the event object.
The actual slot is figured out per FIND-CLASS-SLOT-FUZZY on the
EVENT-TYPE of the handler.
See FIND-CLASS-SLOT-FUZZY
See FILTER
A list of handler names or categories after which this handler should be called.
A list of handler names or categories before which this handler should be called.
Build a lambda form for the event loop delivery function.
The handlers must be in the properly sorted order as returned by
SORT-HANDLERS on the same EVENT-LOOP object as is used to call
this function.
See COMPILED-EVENT-LOOP
list
) (event-loop compiled-event-loop
)) ¶Cancels the event.
An event can be cancelled multiple times though the effect does not change.
Once an event has been cancelled it can only be handled by handlers that
have HANDLE-CANCELLED set to a non-NIL value.
See CANCELLED
See HANDLE-CANCELLED
Accessor to whether the event has been cancelled.
See CANCEL
Finds all direct-slot instances that this class will inherit.
More explicitly, it traverses the superclass tree and gathers all direct-slots it can find.
symbol
)) ¶standard-class
)) ¶cached-slots-class
)) ¶automatically generated reader method
cached-slots-class
)) ¶automatically generated writer method
Performs a primitive, direct delivery of the event on the loop.
This means that handler filters are tested directly without any
possible room for optimisation.
See TEST-FILTER
event
) (event-loop sorted-event-loop
)) ¶event
) (event-loop event-loop
)) ¶The function that is used to deliver events.
See HANDLE
event-delivery
)) ¶automatically generated reader method
event-delivery
)) ¶automatically generated writer method
Deregister the given handler so that it no longer receives events from the event-loop.
Deregistering an unregistered handler will not cause an error.
Deregistering a handler might cause the event loop to be recompiled,
which can be a costly operation.
See RECOMPILE-EVENT-LOOP
list
) (event-loop compiled-event-loop
)) ¶list
) (event-loop sorted-event-loop
)) ¶symbol
) (event-loop event-loop
)) ¶list
) (event-loop event-loop
)) ¶list
) (event-loop event-loop
)) ¶handler
) (event-loop event-loop
)) ¶Ensures that the handlers are properly sorted on the event-loop
See SORTED-HANDLERS
See SORT-HANDLERS
See SORTED-EVENT-LOOP
sorted-event-loop
)) ¶The event that the event condition is about.
event-condition
)) ¶event-condition
)) ¶The slot that the event condition is about.
immutable-event-slot-has-writer
)) ¶slot
.
immutable-event-slot-modified
)) ¶slot
.
immutable-event-slot-has-writer
)) ¶slot
.
immutable-event-slot-modified
)) ¶slot
.
The value that the event condition is about.
immutable-event-slot-modified
)) ¶immutable-event-slot-modified
)) ¶The writers that the event condition is about.
immutable-event-slot-has-writer
)) ¶immutable-event-slot-has-writer
)) ¶The event-loop that the event-loop condition is about.
event-loop-condition
)) ¶event-loop-condition
)) ¶The handler that the event-loop condition is about.
event-loop-handler-dependency-cycle-error
)) ¶event-loop-handler-dependency-cycle-error
)) ¶A lock used to synchronise access to the event-loop slots.
See HANDLERS
See SORTED-HANDLERS
See DELIVERY-FUNCTION
event-loop
)) ¶automatically generated reader method
event-loop
)) ¶automatically generated writer method
Accessor to whether the given EVENT-SLOT is mutable or not.
See EVENT-SLOT
event-slot
)) ¶automatically generated reader method
event-slot
)) ¶automatically generated writer method
The event-type that the handler accepts.
The specification of a filter to figure out which events the handler accepts.
See TEST-FILTER
Directly handle the event by sending it to the handlers.
This function bypasses all threading, caching, ordering, and other
protective or optimisation constructs of the event delivery itself
and processes the event immediately. You should not call this function
on your own unless for when you are implementing an event-delivery on
your own. In that case you should call this function whenever you are
ready to actually process an event and send it out.
By default this simply calls the DELIVERY-FUNCTION of the
event-delivery with the given event.
See ISSUE
event
) (handler condition-notify-handler
)) ¶event
) (handler one-time-handler
)) ¶event
) (globally-blocking-handler globally-blocking-handler
)) ¶event
) (event-loop event-loop
)) ¶event
) (event-loop event-loop
)) ¶%stop
) (event-delivery queued-event-delivery
)) ¶blocking-event
) (event-delivery event-delivery
)) ¶event
) (event-delivery event-delivery
)) ¶event
) (event-delivery event-delivery
)) ¶Accessor to whether the handler will handle events even if they are marked as being cancelled.
Accesses the named handler from the event-loop, if such exists.
Handlers that do not have a NAME will be named by themselves.
handler
) (event-loop event-loop
)) ¶symbol
) (event-loop event-loop
)) ¶event-loop
)) ¶The handler that the handler condition is about.
handler-condition
)) ¶handler-condition
)) ¶The thread that the handler condition is about.
handler-thread-stop-failed-warning
)) ¶handler-thread-stop-failed-warning
)) ¶Handler lock to lock the access to the internal threads list.
See THREADS
globally-blocking-handler
)) ¶automatically generated reader method
parallel-handler
)) ¶automatically generated reader method
globally-blocking-handler
)) ¶automatically generated writer method
parallel-handler
)) ¶automatically generated writer method
An EQL hash-table of the registered handlers on the event-loop. Be careful when modifying this table, as it is not synchronised.
See EVENT-LOOP-LOCK
event-loop
)) ¶automatically generated reader method
event-loop
)) ¶automatically generated writer method
The unique identifier of the group the event belongs to.
identified-event
)) ¶automatically generated reader method
The position of the event within the sequence.
sequence-event
)) ¶automatically generated reader method
Issue an event to the delivery so that it is sent out to the handlers.
The exact point in time when the issued event is handled and processed is not specified. However, the order in which events are handled must be the same as the order in which they are issued. An event should only ever be issued once. There is no check made to ensure this, but issuing an event multiple times or on multiple deliveries leads to undefined behaviour. There is also no check made to see whether the event delivery is actually started and ready to accept events. If it is not started, the events might pile up or be dropped on the floor. This is, essentially, undefined behaviour.
blocking-event
) (parallel-handler parallel-handler
)) ¶event
) (parallel-handler parallel-handler
)) ¶event
) (event-loop event-loop
)) ¶blocking-event
) (event-delivery queued-event-delivery
)) ¶event
) (event-delivery queued-event-delivery
)) ¶event
) (event-delivery event-delivery
)) ¶The universal-time at which the event has been ISSUEd to an event-delivery.
See ISSUE.
Accessor to all the loops the handler is registered on right now.
The maximum index of the sequence.
Might be NIL if the maximum length of the sequence is not yet known.
sequence-event
)) ¶automatically generated reader method
The message of the message-event.
message-event
)) ¶automatically generated reader method
Returns a symbol describing the name of the object.
Some description of an origin from where the event was issued.
See *ORIGIN*
See WITH-ORIGIN
The payload of to be delivered.
payload-event
)) ¶automatically generated reader method
Cause the event loop to be recompiled.
The event-loop’s handlers must already be ready in their sorted
order before calling this function. This operation is potentially
very costly as it involves building a potentially very large
lambda and successively invoking COMPILE on it. With a large number
of registered handlers and a slow compiler, this might take up to
the order of seconds to run.
See BUILD-EVENT-LOOP
See ENSURE-HANDLERS-SORTED
See COMPILED-EVENT-LOOP
compiled-event-loop
)) ¶Register the given handler so that it may receive events from the event-loop.
Registering the same handler twice will still result in it receiving
events only once, but will not cause an error. Registering a handler
might cause the event loop to be recompiled, which can be a costly
operation.
See RECOMPILE-EVENT-LOOP
list
) (event-loop compiled-event-loop
)) ¶list
) (event-loop sorted-event-loop
)) ¶list
) (event-loop event-loop
)) ¶list
) (event-loop event-loop
)) ¶handler
) (event-loop event-loop
)) ¶Accessor to the response event the handler captures.
condition-notify-handler
)) ¶automatically generated reader method
condition-notify-handler
)) ¶automatically generated writer method
Returns T if the event delivery is able to process events.
queued-event-delivery
)) ¶event-delivery
)) ¶list
)) ¶Sort the given list of handlers into the proper issuing sequence.
The returned list of handlers must be ordered in a way that the
BEFORE and AFTER lists of all handlers are met. If a dependency
cycle is detected, an error of type EVENT-LOOP-HANDLER-DEPENDENCY-CYCLE-ERROR
must be signalled.
See SORTED-EVENT-LOOP
list
) (event-loop sorted-event-loop
)) ¶hash-table
) (event-loop sorted-event-loop
)) ¶A list of the registered handlers in their properly sorted order.
This function might become temporarily out of sync with HANDLERS.
See SORT-HANDLERS
See ENSURE-HANDLERS-SORTED
See SORTED-EVENT-LOOP
sorted-event-loop
)) ¶automatically generated reader method
sorted-event-loop
)) ¶automatically generated writer method
Start the event delivery and make it ready to accept and deliver events.
If the delivery is already running this does nothing.
queued-event-delivery
)) ¶event-delivery
)) ¶list
)) ¶Stop the event delivery to prevent it from accepting and delivering events.
If there are events that the handler has yet to process, there is no
guarantee that they will be processed before the event delivery is
stopped.
If the delivery is already stopped this does nothing.
parallel-handler
)) ¶queued-event-delivery
)) ¶event-delivery
)) ¶list
)) ¶The threads of the parallel-handler.
parallel-handler
)) ¶automatically generated reader method
parallel-handler
)) ¶automatically generated writer method
event-class
) name direct-slots) ¶sb-mop
.
event-class
) &rest initargs) ¶sb-mop
.
event-class
) &rest initargs) ¶sb-mop
.
event-class
) &key direct-slots &allow-other-keys) ¶cached-slots-class
) &key) ¶event-loop
) &key) ¶identified-event
) &key) ¶queued-handler
) stream) ¶event-delivery
) stream) ¶event-class
) &key direct-slots &allow-other-keys) ¶cached-slots-class
) &key) ¶event-class
) event (slotd event-slot
)) ¶sb-mop
.
event-class
) (superclass event-class
)) ¶sb-mop
.
event-class
) (superclass standard-class
)) ¶sb-mop
.
standard-class
) (superclass event-class
)) ¶sb-mop
.
event-class
) superclass) ¶sb-mop
.
cached-slots-class
) (superclass cached-slots-class
)) ¶sb-mop
.
cached-slots-class
) (superclass standard-class
)) ¶sb-mop
.
standard-class
) (superclass cached-slots-class
)) ¶sb-mop
.
cached-slots-class
) superclass) ¶sb-mop
.
Condition base class for conditions related to events.
See EVENT-CONDITION-EVENT
condition
.
:event
Condition base class for conditions related to event-loops.
See EVENT-LOOP-CONDITION-EVENT-LOOP
condition
.
:event-loop
An error that is signalled whenever a dependency cycle is detected within the handlers.
See EVENT-LOOP-CONDITION
See EVENT-LOOP-CONDITION-HANDLER
error
.
event-loop-condition
.
:handler
Condition base class for conditions related to handlers.
See HANDLER-CONDITION-HANDLER
condition
.
:handler
A warning that is signalled whenever a thread of a handler fails to stop.
See HANDLER-CONDITION
See HANDLER-CONDITION-THREAD
handler-condition
.
warning
.
:thread
A warning that is signalled whenever an immutable slot is specified with a writer.
See EVENT-CONDITION
See EVENT-CONDITION-SLOT
See EVENT-CONDITION-WRITERS
event-condition
.
style-warning
.
:slot
:writers
An error that is signalled whenever an attempt is made to modify an immutable slot.
See EVENT-CONDITION
See EVENT-CONDITION-SLOT
See EVENT-CONDITION-VALUE
error
.
event-condition
.
:slot
:value
A blocking event.
This event blocks on all handlers it passes through and blocks the issuing
thread until it is done being handled. This behaviour is sometimes desired,
especially in cases where remote communication is involved and sequential
execution on the issuing side must be ensured. This order cannot be
guaranteed with standard events, as while the events are issued in order
and handled in order by the same handler, they might change order between
different handlers.
See EVENT
A metaclass that caches all the direct slot instances available to it.
The cache is renewed on re/initialization of the class.
See CLASS-ALL-DIRECT-SLOTS
standard-class
.
A payload delivery event for which the payload has been cut up into chunks.
See PAYLOAD-EVENT
See SEQUENCE-EVENT
Event used for commands
See DEFINE-COMMAND
An optimised event loop that compiles the issuing function for fast delivery.
Implements a standard queued event loop that respects all other
constraints. Supports rudimentary optimisation of the event loop
handler filter tests to speed up delivery and generates a tight
event delivery function that should allow issuing events to
handlers very efficiently.
See SORTED-EVENT-LOOP
See BUILD-EVENT-LOOP
See RECOMPILE-EVENT-LOOP
Handler that notifies a condition variable once it receives its event.
Saves the received event in its slot.
See ONE-TIME-HANDLER
See CONDITION-VARIABLE
See ISSUE-SYNCHRONIZER-LOCK
See RESPONSE-EVENT
See WITH-RESPONSE
Delivers an error message.
See MESSAGE-EVENT
Base class for all events.
Anything that would like to be processed by an event-delivery must
inherit from this class.
See ISSUE-TIME
See ORIGIN
See CANCELLED
Metaclass for events.
Uses the EVENT-SLOT class for slots, to allow specification of im/mutable slots.
See EVENT-SLOT
A base class for any kind of object that can deliver events.
This class must implement START, STOP, ISSUE, and HANDLE.
See DELIVERY-FUNCTION
Initarg | Value |
---|---|
:delivery-function | (function print) |
:delivery-function
A standard-direct-slot-definition for an event-slot.
event-slot
.
standard-direct-slot-definition
.
A standard-effective-slot-definition for an event-slot.
event-slot
.
standard-effective-slot-definition
.
The base class for an event loop.
This event loop is incredibly crude and should only serve as a basis
for either very specific scenarios or to build a new event-loop on
top of it. It does not sort the handlers properly nor optimise the
delivery in any way but simply tests and calls each handler in
whatever order it might find them in at the moment.
On the other hand, de/registering handlers will be very cheap on
this handler, as no recompilation or analysis is required.
See QUEUED-EVENT-DELIVERY
See HANDLERS
See EVENT-LOOP-LOCK
See SORTED-EVENT-LOOP
See COMPILED-EVENT-LOOP
deliver-event-directly
.
deregister-handler
.
deregister-handler
.
deregister-handler
.
deregister-handler
.
(setf event-loop-lock)
.
event-loop-lock
.
handle
.
handle
.
(setf handler)
.
handler
.
handler
.
(setf handlers)
.
handlers
.
initialize-instance
.
issue
.
register-handler
.
register-handler
.
register-handler
.
Initarg | Value |
---|---|
:delivery-function | nil |
(make-hash-table :test (quote eql))
Base class for the event-slot classes.
Contains one extra field (:MUTABLE) that allows specification of
whether the slot is allowed to be mutated through a writer.
If the user attempts to specify a writer (or accessor) on the slot
while :MUTABLE NIL, a warning of type IMMUTABLE-EVENT-SLOT-HAS-WRITER
is signalled. If an attempt is made to write to a slot that has been
designated immutable, a continuable error of type IMMUTABLE-EVENT-SLOT-MODIFIED
is signalled.
By default slots are immutable.
See EVENT-SLOT-MUTABLE
:mutable
A handler that globally blocks all issuing threads until it is done.
The difference to LOCALLY-BLOCKING-HANDLER is only apparent in the case
where multiple event loops issue to this same handler at the same time,
in which case both are blocked until their individual events are done
being processed.
See HANDLER
See HANDLER-LOCK
(bordeaux-threads:make-recursive-lock "globally-blocking-handler lock")
Base class for all handlers to which events can be delivered.
In order for an event to be issued to this, the following criteria should apply to the event. First, the event must pass the type test against the value from the handler’s EVENT-TYPE slot. Note that the event-type can be a compound type. Second, the event must pass the handler’s FILTER test as per TEST-FILTER.
See EVENT-DELIVERY
See NAME
See EVENT-TYPE
See FILTER
See BEFORE
See AFTER
See HANDLE-CANCELLED
Initarg | Value |
---|---|
:name | nil |
:event-type | (quote event) |
:filter | nil |
:before | nil |
:after | nil |
:handle-cancelled | nil |
:event-type
This slot is read-only.
:handle-cancelled
This slot is read-only.
An event that belongs to a certain identified group.
The identifier defaults to the event itself.
See EVENT
See IDENTIFIER
:identifier
This slot is read-only.
Delivers an informational message.
See MESSAGE-EVENT
A handler that handles the event in the issuing thread and thus blocks it.
This is useful for handlers that need to modify the event they receive,
as then it is guaranteed that the modification is done before any further
handlers can be called with the event.
See HANDLER
A simple event merely used to deliver message strings.
See EVENT
See MESSAGE
Initarg | Value |
---|---|
:message | (error message required.) |
A handler that can only be called until it is successful.
If the delivery-function of the handler returns a non-NIL result, the
handler immediately deregisters itself from all its loops and stops
itself, thus only ever handling one "correct" event.
The return test is done to allow the user more sophisticated testing
of the event than is possible through the filter mechanism.
See QUEUED-HANDLER
See WITH-ONE-TIME-HANDLER
A handler that starts a new thread to handle each event that it receives through ISSUE.
Note that if you use this handler you must care for resource locking
yourself. This can potentially be very tricky and inefficient.
See HANDLER
See THREADS
See HANDLER-LOCK
A simple event used to deliver some kind of data payload.
See EVENT
See PAYLOAD
Initarg | Value |
---|---|
:payload | (error payload required.) |
An event delivery that uses a queue and background thread to deliver events.
See EVENT-DELIVERY
(make-array 100 :adjustable t :fill-pointer 0)
(make-array 100 :adjustable t :fill-pointer 0)
(bordeaux-threads:make-condition-variable :name "queue-condition")
This slot is read-only.
(bordeaux-threads:make-lock "queue-lock")
This slot is read-only.
A handler that uses an event queue and separate thread to process them.
This is the default handler class. Since there is only a single thread per
handler, resources on the handler itself should be safe to access. However,
you still have to tend after locking of external resources on your own as
they might be modified and accessed in any fashion.
Also note that since this is a single, queued handler that any event that
takes a very long time will block other events on the handler from being
processed. It will not however block the event-loop from which the events are
issued.
See HANDLER
See QUEUED-EVENT-DELIVERY
An event that is part of a sequence of events.
See EVENT
See INDEX
See MAX-INDEX
Initarg | Value |
---|---|
:index | (error index required.) |
:max-index | nil |
An event loop that respects the sorting order of handlers.
This event loop will always make sure the handlers are in proper
order to be called in, but does not perform any further optimisation.
As such, this handler should still be reasonably fast to de/register
handlers on, but will obviously suffer the deficiencies in issuing
due to the lack of optimisation.
See EVENT-LOOP
See SORTED-HANDLERS
See COMPILED-EVENT-LOOP
Stream event to signal the beginning of a stream.
All further stream events that belong to this stream must have the same identifier as this. Events belonging to this stream may appear until a STREAM-END-EVENT has been issued belonging to this stream.
See STREAM-EVENT
Stream event to signal the end of a stream.
See STREAM-EVENT
Initarg | Value |
---|---|
:identifier | (error identifier required.) |
Base event for stream events.
All stream events that belong to the same stream must have the same
identifier. Stream events are insignificant unless they are issued
after a STREAM-BEGIN-EVENT of the same identifier and before a
STREAM-END-EVENT of the same identifier.
See IDENTIFIED-EVENT
A payload event for a particular stream.
See PAYLOAD-EVENT
See STREAM-EVENT
Initarg | Value |
---|---|
:identifier | (error identifier required.) |
Delivers a warning message.
See MESSAGE-EVENT
Constructs an appropriate accessor form to read/write the given slot-ish.
FIND-CLASS-SLOT-FOR-COMPOUND is used to find an appropriate slot.
If no appropriate slot can be found, an error is signalled.
FIND-SLOT-ACCESSOR is used to detect if an accessor can be
used. If no accessor is found, a SLOT-VALUE form is emitted
instead.
Returns the form and the slot instance.
See FIND-CLASS-SLOT-FUZZY
See FIND-SLOT-ACCESSOR
Checks the given slot-forms to see if any immutable slots have writers.
If such a slot is found, a warning of type IMMUTABLE-EVENT-SLOT-HAS-WRITER is signalled.
Check that all functions, classes, and variables have docstrings.
Compiles the given LAMBDA form into a function object.
Attempts to muffle all warnings and notes during compilation.
Copies the hash table.
This does not respect potential implementation-dependent hash-table properties.
Attempts to find a slot on COMPOUND that matches SLOT-ISH
This allows compound type specifiers for the class, but only for OR and AND.
For the purpose of finding the appropriate slot, the semantics of the compound
are disregarded. The compound is searched in depth-first order and the first
matching slot wins. The actual slot finding for each class is performed by
FIND-CLASS-SLOT-FUZZY.
See FIND-CLASS-SLOT-FUZZY
Attempts to find a slot on CLASS that matches SLOT-ISH
A slot is found if SLOT-ISH matches by either slot-name or one
of the readers of the slot through either an EQL or STRING= comparison.
If no appropriate slot can be found, NIL is returned instead.
See CLASS-ALL-DIRECT-SLOTS
Attempts to find an accessor for the given slot.
This works by looping through all writers and seeing if there’s a corresponding reader for it. In the case of a (setf foo) writer it looks for a foo reader.
Formats UNIVERSAL-TIME into a datestring of the following format: YYYY.MM.DD hh:mm:ss
Constructs a copy of LIST, removing the plist properties REMOVE-PROPERTIES.
queued-event-delivery
)) ¶automatically generated reader method
queued-event-delivery
)) ¶automatically generated writer method
A condition variable accessor.
condition-notify-handler
)) ¶automatically generated reader method
condition-notify-handler
)) ¶automatically generated writer method
blocking-event
)) ¶automatically generated reader method
done
.
blocking-event
)) ¶automatically generated writer method
done
.
queued-event-delivery
)) ¶automatically generated reader method
queued-event-delivery
)) ¶automatically generated writer method
Accessor to the lock used to synchronise the handler with the issuer.
condition-notify-handler
)) ¶automatically generated reader method
condition-notify-handler
)) ¶automatically generated writer method
queued-event-delivery
)) ¶queued-event-delivery
)) ¶automatically generated reader method
queued-event-delivery
)) ¶automatically generated reader method
queued-event-delivery
)) ¶automatically generated reader method
queued-event-delivery
)) ¶automatically generated writer method
Jump to: | (
A B C D E F G H I L M N O P Q R S T U V W |
---|
Jump to: | (
A B C D E F G H I L M N O P Q R S T U V W |
---|
Jump to: | *
A B C D E F H I L M N O P Q R S T V W |
---|
Jump to: | *
A B C D E F H I L M N O P Q R S T V W |
---|
Jump to: | %
B C D E F G H I L M O P Q S T W |
---|
Jump to: | %
B C D E F G H I L M O P Q S T W |
---|