The event-glue Reference Manual

This is the event-glue Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 18:01:13 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 event-glue

A simple framework for event-based architectures.

Author

Andrew Danger Lyon <>

License

MIT

Version

0.1.0

Source

event-glue.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 event-glue/event-glue.asd

Source

event-glue.asd.

Parent Component

event-glue (system).

ASDF Systems

event-glue.


3.1.2 event-glue/package.lisp

Source

event-glue.asd.

Parent Component

event-glue (system).

Packages

event-glue.


3.1.3 event-glue/event.lisp

Dependency

package.lisp (file).

Source

event-glue.asd.

Parent Component

event-glue (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 event-glue

Source

package.lisp.

Nickname

ev

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *dispatch*

Our global dispatch handler. This is the default handler used if a dispatcher is not specified in event operations.

Package

event-glue.

Source

event.lisp.


5.1.2 Ordinary functions

Function: bind (event-name function &key name on)

Bind a function to an event. Optionally allows naming the binding so it can be removed later on without the reference to the bound function.

Package

event-glue.

Source

event.lisp.

Function: bind-once (event-name function &key name on)

Bind a function to an event, but clear the binding out once the event has been triggered once.

Package

event-glue.

Source

event.lisp.

Function: event (name &key data meta type)

Easy wrapper for creating a standard event object. Meta is a plist of optional data to set (top-level) into the event object.

Package

event-glue.

Source

event.lisp.

Function: forward (from to-or-function)

Forward events from one dispatcher to another. If the second dispatcher is given as a function, that function must return either another dispatcher or nil. This lets you forward specific events at runtime based on data within the event.

Package

event-glue.

Source

event.lisp.

Function: forwardsp (from to-or-function)

Determine if the given from -> to forward is active. Returns either to-or-function or nil.

Package

event-glue.

Source

event.lisp.

Function: make-dispatch (&optional type)

Make a dispatcher.

Package

event-glue.

Source

event.lisp.

Function: trigger (event &key on)

Trigger en event.

Package

event-glue.

Source

event.lisp.

Function: unbind (event-name function-or-name &key on)

Unbind an event/function pair. If function-or-name contains a non-function value, the value is used in a name lookup instead. This allows removing an event/function binding by its name (as specified by :name in the bind function) which can be nice when the original lambda is no longer around.

Package

event-glue.

Source

event.lisp.

Function: unbind-all (event-name &key on)

Unbind all handlers for the given event name.

Package

event-glue.

Source

event.lisp.

Function: unforward (from to-or-function)

Undo a forward created by forward.

Package

event-glue.

Source

event.lisp.

Function: wipe (&key preserve-forwards on)

Wipe out all handlers for a dispatch object.

Package

event-glue.

Source

event.lisp.


5.1.3 Generic functions

Generic Reader: data (object)
Generic Writer: (setf data) (object)
Package

event-glue.

Methods
Reader Method: data ((event event))
Writer Method: (setf data) ((event event))

Arbitrary data attached to the event. Usually a set of args.

Source

event.lisp.

Target Slot

data.

Generic Reader: ev (object)
Generic Writer: (setf ev) (object)
Package

event-glue.

Methods
Reader Method: ev ((event event))
Writer Method: (setf ev) ((event event))

Holds the event’s name.

Source

event.lisp.

Target Slot

ev.

Generic Reader: meta (object)
Generic Writer: (setf meta) (object)
Package

event-glue.

Methods
Reader Method: meta ((event event))
Writer Method: (setf meta) ((event event))

Any top-level meta associated with the event, used to describe it.

Source

event.lisp.

Target Slot

meta.


5.1.4 Standalone methods

Method: print-object ((event event) s)
Source

event.lisp.


5.1.5 Classes

Class: dispatch

The dispatch class is what event listeners bind to. Events flow throw it.

Package

event-glue.

Source

event.lisp.

Direct methods
Direct slots
Slot: handlers

Holds the dispatcher’s event handlers (event-name -> fn).

Initform

(make-hash-table :test (function equal))

Readers

dispatch-handlers.

Writers

(setf dispatch-handlers).

Slot: handler-names

Holds named event name -> fn bindings for easy lookups.

Initform

(make-hash-table :test (function equal))

Readers

dispatch-handler-names.

Writers

(setf dispatch-handler-names).

Slot: forwards

Holds any other dispatchers this dispatcher forwards to.

Initargs

:forwards

Readers

dispatch-forwards.

Writers

(setf dispatch-forwards).

Class: event

Describes an event and any data it holds.

Package

event-glue.

Source

event.lisp.

Direct methods
Direct slots
Slot: ev

Holds the event’s name.

Initargs

:ev

Readers

ev.

Writers

(setf ev).

Slot: data

Arbitrary data attached to the event. Usually a set of args.

Initargs

:data

Readers

data.

Writers

(setf data).

Slot: meta

Any top-level meta associated with the event, used to describe it.

Initform

(make-hash-table :test (function equal))

Initargs

:meta

Readers

meta.

Writers

(setf meta).


5.2 Internals


5.2.1 Ordinary functions

Function: make-lookup-name (event-name name)

Standardizes the naming convention for named event names.

Package

event-glue.

Source

event.lisp.


5.2.2 Generic functions

Generic Reader: dispatch-forwards (object)
Generic Writer: (setf dispatch-forwards) (object)
Package

event-glue.

Methods
Reader Method: dispatch-forwards ((dispatch dispatch))
Writer Method: (setf dispatch-forwards) ((dispatch dispatch))

Holds any other dispatchers this dispatcher forwards to.

Source

event.lisp.

Target Slot

forwards.

Generic Reader: dispatch-handler-names (object)
Generic Writer: (setf dispatch-handler-names) (object)
Package

event-glue.

Methods
Reader Method: dispatch-handler-names ((dispatch dispatch))
Writer Method: (setf dispatch-handler-names) ((dispatch dispatch))

Holds named event name -> fn bindings for easy lookups.

Source

event.lisp.

Target Slot

handler-names.

Generic Reader: dispatch-handlers (object)
Generic Writer: (setf dispatch-handlers) (object)
Package

event-glue.

Methods
Reader Method: dispatch-handlers ((dispatch dispatch))
Writer Method: (setf dispatch-handlers) ((dispatch dispatch))

Holds the dispatcher’s event handlers (event-name -> fn).

Source

event.lisp.

Target Slot

handlers.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
B   D   E   F   G   M   P   T   U   W  
Index Entry  Section

(
(setf data): Public generic functions
(setf data): Public generic functions
(setf dispatch-forwards): Private generic functions
(setf dispatch-forwards): Private generic functions
(setf dispatch-handler-names): Private generic functions
(setf dispatch-handler-names): Private generic functions
(setf dispatch-handlers): Private generic functions
(setf dispatch-handlers): Private generic functions
(setf ev): Public generic functions
(setf ev): Public generic functions
(setf meta): Public generic functions
(setf meta): Public generic functions

B
bind: Public ordinary functions
bind-once: Public ordinary functions

D
data: Public generic functions
data: Public generic functions
dispatch-forwards: Private generic functions
dispatch-forwards: Private generic functions
dispatch-handler-names: Private generic functions
dispatch-handler-names: Private generic functions
dispatch-handlers: Private generic functions
dispatch-handlers: Private generic functions

E
ev: Public generic functions
ev: Public generic functions
event: Public ordinary functions

F
forward: Public ordinary functions
forwardsp: Public ordinary functions
Function, bind: Public ordinary functions
Function, bind-once: Public ordinary functions
Function, event: Public ordinary functions
Function, forward: Public ordinary functions
Function, forwardsp: Public ordinary functions
Function, make-dispatch: Public ordinary functions
Function, make-lookup-name: Private ordinary functions
Function, trigger: Public ordinary functions
Function, unbind: Public ordinary functions
Function, unbind-all: Public ordinary functions
Function, unforward: Public ordinary functions
Function, wipe: Public ordinary functions

G
Generic Function, (setf data): Public generic functions
Generic Function, (setf dispatch-forwards): Private generic functions
Generic Function, (setf dispatch-handler-names): Private generic functions
Generic Function, (setf dispatch-handlers): Private generic functions
Generic Function, (setf ev): Public generic functions
Generic Function, (setf meta): Public generic functions
Generic Function, data: Public generic functions
Generic Function, dispatch-forwards: Private generic functions
Generic Function, dispatch-handler-names: Private generic functions
Generic Function, dispatch-handlers: Private generic functions
Generic Function, ev: Public generic functions
Generic Function, meta: Public generic functions

M
make-dispatch: Public ordinary functions
make-lookup-name: Private ordinary functions
meta: Public generic functions
meta: Public generic functions
Method, (setf data): Public generic functions
Method, (setf dispatch-forwards): Private generic functions
Method, (setf dispatch-handler-names): Private generic functions
Method, (setf dispatch-handlers): Private generic functions
Method, (setf ev): Public generic functions
Method, (setf meta): Public generic functions
Method, data: Public generic functions
Method, dispatch-forwards: Private generic functions
Method, dispatch-handler-names: Private generic functions
Method, dispatch-handlers: Private generic functions
Method, ev: Public generic functions
Method, meta: Public generic functions
Method, print-object: Public standalone methods

P
print-object: Public standalone methods

T
trigger: Public ordinary functions

U
unbind: Public ordinary functions
unbind-all: Public ordinary functions
unforward: Public ordinary functions

W
wipe: Public ordinary functions