Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the laap Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 13:57:46 2020 GMT+0.
• Introduction | What laap is all about | |
• Systems | The systems documentation | |
• Modules | The modules documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
A Common Lisp multi-threaded event loop.
From micro-benchmarks run on a random laptop (i.e. ballpark numbers to give a rough idea), a small HTTP server could handle:
Tested on linux/sbcl x86-64 only. (But definitely open to compatibility fixes.)
What motivated the creation of this library:
(laap:with-event-loop
(let ((socket (make-instance 'laap/socket:ipv4-tcp-socket)))
(laap/socket:connect socket
(lambda (err res)
(when err (error err))
(laap/socket:send socket
:data (babel:string-to-octets "foo")))
:ip "127.0.0.1"
:port 80)))
This snippet creates a TCP socket to 127.0.0.1:80
and send the
string foo
to it.
More examples in the t/
folder.
Currently, laap supports:
laap plans on supporting the following features:
The API is based on callbacks. All the callbacks must accept 2
arguments: an error (possibly nil
) and a result (possibly nil
too). This allows for easy wrapping around the callbacks.
TODO.
TODO.
TODO.
TODO.
This library is provided under the MIT license. See LICENSE.
Next: Modules, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The laap system |
Florian Margaine <florian@margaine.com>
MIT
A Common Lisp multi-threaded event loop.
laap.asd (file)
Modules are listed depth-first from the system components tree.
• The laap/core module | ||
• The laap/socket module | ||
• The laap/fs module |
Next: The laap/socket module, Previous: Modules, Up: Modules [Contents][Index]
laap (system)
core/
Next: The laap/fs module, Previous: The laap/core module, Up: Modules [Contents][Index]
core (module)
laap (system)
socket/
Previous: The laap/socket module, Up: Modules [Contents][Index]
socket (module)
laap (system)
fs/
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
Next: The laap/core/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
laap.asd
laap (system)
Next: The laap/core/laap․lisp file, Previous: The laap․asd file, Up: Lisp files [Contents][Index]
Next: The laap/core/cffi․lisp file, Previous: The laap/core/package․lisp file, Up: Lisp files [Contents][Index]
core (module)
core/laap.lisp
Next: The laap/core/timer․lisp file, Previous: The laap/core/laap․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
core (module)
core/cffi.lisp
errno (symbol macro)
Next: The laap/core/loop․lisp file, Previous: The laap/core/cffi․lisp file, Up: Lisp files [Contents][Index]
core (module)
core/timer.lisp
Next: The laap/core/thread-pool․lisp file, Previous: The laap/core/timer․lisp file, Up: Lisp files [Contents][Index]
core (module)
core/loop.lisp
*recv-buffer-length* (special variable)
Next: The laap/core/condition․lisp file, Previous: The laap/core/loop․lisp file, Up: Lisp files [Contents][Index]
core (module)
core/thread-pool.lisp
Next: The laap/socket/package․lisp file, Previous: The laap/core/thread-pool․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
core (module)
core/condition.lisp
Next: The laap/socket/socket․lisp file, Previous: The laap/core/condition․lisp file, Up: Lisp files [Contents][Index]
socket (module)
socket/package.lisp
Next: The laap/socket/cffi․lisp file, Previous: The laap/socket/package․lisp file, Up: Lisp files [Contents][Index]
socket (module)
socket/socket.lisp
Next: The laap/fs/package․lisp file, Previous: The laap/socket/socket․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
socket (module)
socket/cffi.lisp
Next: The laap/fs/cffi․lisp file, Previous: The laap/socket/cffi․lisp file, Up: Lisp files [Contents][Index]
Next: The laap/fs/fs․lisp file, Previous: The laap/fs/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
fs (module)
fs/cffi.lisp
Previous: The laap/fs/cffi․lisp file, Up: Lisp files [Contents][Index]
fs (module)
fs/fs.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The laap package | ||
• The laap/socket package | ||
• The laap/fs package |
Next: The laap/socket package, Previous: Packages, Up: Packages [Contents][Index]
package.lisp (file)
common-lisp
Next: The laap/fs package, Previous: The laap package, Up: Packages [Contents][Index]
package.lisp (file)
common-lisp
Previous: The laap/socket package, Up: Packages [Contents][Index]
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported symbol macros | ||
• Exported macros | ||
• Exported functions | ||
• Exported generic functions | ||
• Exported conditions | ||
• Exported classes |
Next: Exported symbol macros, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Next: Exported macros, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
Next: Exported functions, Previous: Exported symbol macros, Up: Exported definitions [Contents][Index]
thread-pool.lisp (file)
Run code in the laap event loop.
Next: Exported generic functions, Previous: Exported macros, Up: Exported definitions [Contents][Index]
thread-pool.lisp (file)
Run a callback in a specified amount of seconds.
timer.lisp (file)
Make a hard-link from newpath to oldpath.
Rename oldpath to newpath.
Immediately run a callback.
timer.lisp (file)
Make a symbolic link at linkpath pointing to target.
Next: Exported conditions, Previous: Exported functions, Up: Exported definitions [Contents][Index]
Accept a connection from a socket.
socket.lisp (file)
Add a timer to the event loop.
timer.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated reader method
timer.lisp (file)
Close the socket.
socket.lisp (file)
Close the backed file.
Connect the socket.
socket.lisp (file)
automatically generated reader method
timer.lisp (file)
condition.lisp (file)
automatically generated reader method
timer.lisp (file)
Handles an error for a timer.
timer.lisp (file)
socket.lisp (file)
Handles an event for a timer.
timer.lisp (file)
socket.lisp (file)
socket.lisp (file)
socket.lisp (file)
socket.lisp (file)
Listen on a socket.
socket.lisp (file)
Read a specified amount of bytes from a file.
Receive data from a socket.
socket.lisp (file)
Remove a timer from the event loop.
timer.lisp (file)
Send data over a socket.
socket.lisp (file)
Truncate a file to a specified length.
Write specified data to a file.
Next: Exported classes, Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
condition.lisp (file)
condition (condition)
condition.lisp (file)
condition (condition)
:errno
errno (generic function)
Previous: Exported conditions, Up: Exported definitions [Contents][Index]
An object abstracting over a file.
fs.lisp (file)
standard-object (class)
:path
path (generic function)
(setf path) (generic function)
laap/fs::direction
:direction
direction (generic function)
laap/fs::if-does-not-exist
:if-does-not-exist
if-does-not-exist (generic function)
(setf if-does-not-exist) (generic function)
Implementation of an IPv4 TCP socket.
socket.lisp (file)
socket (class)
A timer is an object whose file descriptor is added
to epoll, used to maintain the mapping between the file descriptor
and the callback, at the minimum. Other fields can be used for
further synchronization and bookkeeping matters.
timer.lisp (file)
standard-object (class)
:fd
fd (generic function)
:direction
direction (generic function)
:callback
callback (generic function)
closed (generic function)
(setf closed) (generic function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal constants | ||
• Internal special variables | ||
• Internal symbol macros | ||
• Internal functions | ||
• Internal generic functions | ||
• Internal classes | ||
• Internal types |
Next: Internal special variables, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
Next: Internal symbol macros, Previous: Internal constants, Up: Internal definitions [Contents][Index]
thread-pool.lisp (file)
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
cffi.lisp (file)
(laap/socket::%var-accessor-errno)
Next: Internal generic functions, Previous: Internal symbol macros, Up: Internal definitions [Contents][Index]
thread-pool.lisp (file)
cffi.lisp (file)
thread-pool.lisp (file)
timer.lisp (file)
thread-pool.lisp (file)
thread-pool.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
thread-pool.lisp (file)
cffi.lisp (file)
thread-pool.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
cffi.lisp (file)
thread-pool.lisp (file)
thread-pool.lisp (file)
cffi.lisp (file)
thread-pool.lisp (file)
Next: Internal classes, Previous: Internal functions, Up: Internal definitions [Contents][Index]
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
automatically generated reader method
timer.lisp (file)
automatically generated writer method
timer.lisp (file)
automatically generated reader method
socket.lisp (file)
automatically generated writer method
socket.lisp (file)
automatically generated reader method
socket.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
Execute an action.
thread-pool.lisp (file)
automatically generated reader method
socket.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
automatically generated reader method
socket.lisp (file)
automatically generated reader method
socket.lisp (file)
automatically generated reader method
socket.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated reader method
thread-pool.lisp (file)
automatically generated writer method
thread-pool.lisp (file)
Next: Internal types, Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
thread-pool.lisp (file)
standard-object (class)
thread-pool.lisp (file)
standard-object (class)
lock (generic function)
(setf lock) (generic function)
event (generic function)
(setf event) (generic function)
result (generic function)
(setf result) (generic function)
loop.lisp (file)
standard-object (class)
timers (generic function)
(setf timers) (generic function)
timers-lock (generic function)
(setf timers-lock) (generic function)
efd (generic function)
(setf efd) (generic function)
started (generic function)
(setf started) (generic function)
cffi.lisp (file)
cffi.lisp (file)
An object abstracting over a socket.
socket.lisp (file)
standard-object (class)
ipv4-tcp-socket (class)
:fd
fd (generic function)
socket-domain (generic function)
socket-type (generic function)
socket-protocol (generic function)
A socket-based event loop timer.
socket.lisp (file)
timer (class)
handle-error (method)
thread-pool.lisp (file)
standard-object (class)
event (generic function)
(setf event) (generic function)
queue (generic function)
(setf queue) (generic function)
lock (generic function)
(setf lock) (generic function)
threads (generic function)
(setf threads) (generic function)
max-event-loops (generic function)
(setf max-event-loops) (generic function)
action-queue (generic function)
(setf action-queue) (generic function)
action-queue-lock (generic function)
(setf action-queue-lock) (generic function)
reporters (generic function)
(setf reporters) (generic function)
reporters-lock (generic function)
(setf reporters-lock) (generic function)
thread-pool.lisp (file)
standard-object (class)
:blocking
blocking (generic function)
(setf blocking) (generic function)
Event loop timer for the socket’s accept method.
socket.lisp (file)
socket-timer (class)
handle-event (method)
laap/socket::+epollin+
Event loop timer for the socket’s connect method.
socket.lisp (file)
socket-timer (class)
handle-event (method)
laap/socket::+epollout+
Event loop timer for the socket’s receive method.
socket.lisp (file)
socket-timer (class)
laap/socket::+epollin+
:end-callback
end-callback (generic function)
Event loop timer for the socket’s send method.
socket.lisp (file)
socket-timer (class)
laap/socket::+epollout+
:data
data (generic function)
(setf data) (generic function)
A POSIX timer-based timer. Used to run callbacks in a given amount of time.
timer.lisp (file)
timer (class)
laap::+epollin+
Previous: Internal classes, Up: Internal definitions [Contents][Index]
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L M |
---|
Jump to: | F L M |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
(
A B C D E F G H I L M N P Q R S T U W |
---|
Jump to: | %
(
A B C D E F G H I L M N P Q R S T U W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
+
A B C D E F I L M P Q R S T |
---|
Jump to: | *
+
A B C D E F I L M P Q R S T |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | A B C D E F I L N O P S T U |
---|
Jump to: | A B C D E F I L N O P S T U |
---|