The weft Reference Manual

This is the weft Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed May 15 07:20:35 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 weft

A TCP server framework, like Hunchentoot for TCP.

Author

Matthew Stickney <>

License

MIT

Dependencies
  • usocket (system).
  • bordeaux-threads (system).
  • log4cl (system).
  • trivial-timeout (system).
Source

weft.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 weft/weft.asd

Source

weft.asd.

Parent Component

weft (system).

ASDF Systems

weft.


3.1.2 weft/package.lisp

Source

weft.asd.

Parent Component

weft (system).

Packages

weft.


3.1.3 weft/weft.lisp

Dependency

package.lisp (file).

Source

weft.asd.

Parent Component

weft (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 weft

Source

package.lisp.

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 Symbol macros

Symbol Macro: *shutdown*
Package

weft.

Source

weft.lisp.


5.1.2 Generic functions

Generic Function: add-task (manager thunk)

Add a task to execute THUNK to MANAGER. Returns a
unique ID for the task. If the manager cannot accept a new task, signals an error of type MANAGER-FULL-ERROR.

Package

weft.

Source

weft.lisp.

Methods
Method: add-task ((manager threaded-task-manager) thunk)
Generic Function: all-tasks (manager)

Return a list of the ids of all tasks in MANAGER.

Package

weft.

Source

weft.lisp.

Methods
Method: all-tasks ((manager threaded-task-manager))
Generic Function: find-task (manager task-id)

Return the entry for TASK-ID from MANAGER.

Package

weft.

Source

weft.lisp.

Methods
Method: find-task ((manager threaded-task-manager) (task symbol))
Generic Function: remove-task (manager task)

Remove TASK from the task-manager MANAGER.

Package

weft.

Source

weft.lisp.

Methods
Method: remove-task ((manager threaded-task-manager) (task symbol))
Generic Function: run (server &key backlog element-type)
Package

weft.

Source

weft.lisp.

Methods
Method: run ((server server) &key backlog element-type)
Generic Reader: server-address (object)
Package

weft.

Methods
Reader Method: server-address ((server server))

automatically generated reader method

Source

weft.lisp.

Target Slot

address.

Generic Writer: (setf server-address) (object)
Package

weft.

Methods
Writer Method: (setf server-address) ((server server))

automatically generated writer method

Source

weft.lisp.

Target Slot

address.

Generic Reader: server-connection-handler (object)
Package

weft.

Methods
Reader Method: server-connection-handler ((server server))

automatically generated reader method

Source

weft.lisp.

Target Slot

connection-handler.

Generic Writer: (setf server-connection-handler) (object)
Package

weft.

Methods
Writer Method: (setf server-connection-handler) ((server server))

automatically generated writer method

Source

weft.lisp.

Target Slot

connection-handler.

Generic Reader: server-port (object)
Package

weft.

Methods
Reader Method: server-port ((server server))

automatically generated reader method

Source

weft.lisp.

Target Slot

port.

Generic Writer: (setf server-port) (object)
Package

weft.

Methods
Writer Method: (setf server-port) ((server server))

automatically generated writer method

Source

weft.lisp.

Target Slot

port.

Generic Reader: server-socket (object)
Package

weft.

Methods
Reader Method: server-socket ((server server))

automatically generated reader method

Source

weft.lisp.

Target Slot

socket.

Generic Writer: (setf server-socket) (object)
Package

weft.

Methods
Writer Method: (setf server-socket) ((server server))

automatically generated writer method

Source

weft.lisp.

Target Slot

socket.

Generic Reader: server-task-manager (object)
Package

weft.

Methods
Reader Method: server-task-manager ((server server))

automatically generated reader method

Source

weft.lisp.

Target Slot

task-manager.

Generic Writer: (setf server-task-manager) (object)
Package

weft.

Methods
Writer Method: (setf server-task-manager) ((server server))

automatically generated writer method

Source

weft.lisp.

Target Slot

task-manager.

Generic Function: slots-available-p (manager)

Return T if there is capacity to add a new task to MANAGER, NIL otherwise.

Package

weft.

Source

weft.lisp.

Methods
Method: slots-available-p ((manager threaded-task-manager))
Generic Function: stop (server)
Package

weft.

Source

weft.lisp.

Methods
Method: stop ((server server))
Generic Function: stop-accepting (server)
Package

weft.

Source

weft.lisp.

Methods
Method: stop-accepting ((server server))
Generic Function: stop-task (manager task)

Perform shutdown of the TASK in MANAGER.

Package

weft.

Source

weft.lisp.

Methods
Method: stop-task ((manager threaded-task-manager) (task symbol))

5.1.3 Standalone methods

Method: initialize-instance :after ((instance server) &key max-connections manager &allow-other-keys)
Source

weft.lisp.


5.1.4 Conditions

Condition: manager-full-error
Package

weft.

Source

weft.lisp.

Direct superclasses

error.

Direct methods
Direct slots
Slot: manager
Initargs

:manager

Readers

manager.

Writers

(setf manager).

Condition: thread-shutdown
Package

weft.

Source

weft.lisp.

Direct superclasses

condition.


5.1.5 Classes

Class: server
Package

weft.

Source

weft.lisp.

Direct methods
Direct Default Initargs
InitargValue
:args(quote nil)
Direct slots
Slot: task-manager
Initargs

:manager

Readers

server-task-manager.

Writers

(setf server-task-manager).

Slot: socket
Readers

server-socket.

Writers

(setf server-socket).

Slot: address
Initargs

:address

Readers

server-address.

Writers

(setf server-address).

Slot: port
Initargs

:port

Readers

server-port.

Writers

(setf server-port).

Slot: max-connections
Initargs

:max-connections

Readers

max-connections.

Writers

This slot is read-only.

Slot: acceptor-task
Readers

server-acceptor-task.

Writers

(setf server-acceptor-task).

Slot: connection-handler
Initargs

:handler

Readers

server-connection-handler.

Writers

(setf server-connection-handler).

Slot: handler-args
Initargs

:args

Readers

server-handler-args.

Writers

(setf server-handler-args).

Class: task-manager
Package

weft.

Source

weft.lisp.

Direct subclasses

threaded-task-manager.

Direct methods
Direct Default Initargs
InitargValue
:limitnil
Direct slots
Slot: limit
Initargs

:limit

Readers

task-limit.

Writers

(setf task-limit).

Slot: count
Package

common-lisp.

Initform

0

Readers

task-count.

Writers

(setf task-count).

Class: threaded-task-manager

Class implementing a thread-per-connection task manager.

Package

weft.

Source

weft.lisp.

Direct superclasses

task-manager.

Direct methods
Direct slots
Slot: tasks
Initform

(quote nil)

Readers

tasks.

Writers

(setf tasks).

Slot: task-lock
Initform

(bordeaux-threads:make-recursive-lock)

Readers

task-lock.

Writers

This slot is read-only.

Slot: shutdown-vars
Initform

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

Readers

shutdown-vars.

Writers

(setf shutdown-vars).


5.2 Internals


5.2.1 Special variables

Special Variable: *id-counter*
Package

weft.

Source

weft.lisp.


5.2.2 Ordinary functions

Reader: %ref-lock (instance)
Writer: (setf %ref-lock) (instance)
Package

weft.

Source

weft.lisp.

Target Slot

lock.

Reader: %ref-val (instance)
Writer: (setf %ref-val) (instance)
Package

weft.

Source

weft.lisp.

Target Slot

val.

Function: acceptor-func (server)
Package

weft.

Source

weft.lisp.

Function: connection-handler-func (server sock handler)

Return a wrapper func for HANDLER that will ensure SOCK is closed at exit.

Package

weft.

Source

weft.lisp.

Function: copy-ref (instance)
Package

weft.

Source

weft.lisp.

Function: gen-id ()
Package

weft.

Source

weft.lisp.

Function: make-ref (&key val lock)
Package

weft.

Source

weft.lisp.

Function: prompt-for (type format-string &rest format-args)

Prompt for a value of type TYPE, using FORMAT-STRING and FORMAT-ARGS to produce the prompt. Signals an error if the value read is not of type TYPE.

Package

weft.

Source

weft.lisp.

Function: ref-p (object)
Package

weft.

Source

weft.lisp.

Function: ref-val (ref)
Package

weft.

Source

weft.lisp.

Function: (setf ref-val) (ref)
Package

weft.

Source

weft.lisp.

Function: size-of (obj)
Package

weft.

Source

weft.lisp.


5.2.3 Generic functions

Generic Reader: manager (condition)
Generic Writer: (setf manager) (condition)
Package

weft.

Methods
Reader Method: manager ((condition manager-full-error))
Writer Method: (setf manager) ((condition manager-full-error))
Source

weft.lisp.

Target Slot

manager.

Generic Reader: max-connections (object)
Package

weft.

Methods
Reader Method: max-connections ((server server))

automatically generated reader method

Source

weft.lisp.

Target Slot

max-connections.

Generic Reader: server-acceptor-task (object)
Package

weft.

Methods
Reader Method: server-acceptor-task ((server server))

automatically generated reader method

Source

weft.lisp.

Target Slot

acceptor-task.

Generic Writer: (setf server-acceptor-task) (object)
Package

weft.

Methods
Writer Method: (setf server-acceptor-task) ((server server))

automatically generated writer method

Source

weft.lisp.

Target Slot

acceptor-task.

Generic Reader: server-handler-args (object)
Package

weft.

Methods
Reader Method: server-handler-args ((server server))

automatically generated reader method

Source

weft.lisp.

Target Slot

handler-args.

Generic Writer: (setf server-handler-args) (object)
Package

weft.

Methods
Writer Method: (setf server-handler-args) ((server server))

automatically generated writer method

Source

weft.lisp.

Target Slot

handler-args.

Generic Reader: shutdown-vars (object)
Package

weft.

Methods
Reader Method: shutdown-vars ((threaded-task-manager threaded-task-manager))

automatically generated reader method

Source

weft.lisp.

Target Slot

shutdown-vars.

Generic Writer: (setf shutdown-vars) (object)
Package

weft.

Methods
Writer Method: (setf shutdown-vars) ((threaded-task-manager threaded-task-manager))

automatically generated writer method

Source

weft.lisp.

Target Slot

shutdown-vars.

Generic Reader: task-count (object)
Package

weft.

Methods
Reader Method: task-count ((task-manager task-manager))

automatically generated reader method

Source

weft.lisp.

Target Slot

count.

Generic Writer: (setf task-count) (object)
Package

weft.

Methods
Writer Method: (setf task-count) ((task-manager task-manager))

automatically generated writer method

Source

weft.lisp.

Target Slot

count.

Generic Reader: task-id (condition)
Generic Writer: (setf task-id) (condition)
Package

weft.

Methods
Reader Method: task-id ((condition task-exists-error))
Writer Method: (setf task-id) ((condition task-exists-error))
Source

weft.lisp.

Target Slot

id.

Generic Reader: task-limit (object)
Package

weft.

Methods
Reader Method: task-limit ((task-manager task-manager))

automatically generated reader method

Source

weft.lisp.

Target Slot

limit.

Generic Writer: (setf task-limit) (object)
Package

weft.

Methods
Writer Method: (setf task-limit) ((task-manager task-manager))

automatically generated writer method

Source

weft.lisp.

Target Slot

limit.

Generic Reader: task-lock (object)
Package

weft.

Methods
Reader Method: task-lock ((threaded-task-manager threaded-task-manager))

automatically generated reader method

Source

weft.lisp.

Target Slot

task-lock.

Generic Function: task-shutdown-p (manager task-id)

Return a boolean indicating whether the task identified by TASK-ID in MANAGER should shut down.

Package

weft.

Source

weft.lisp.

Methods
Method: task-shutdown-p ((manager threaded-task-manager) (task-id symbol))
Generic Function: (setf task-shutdown-p) (manager task-id)

Set the shutdown variable for the task identified by TASK-ID in MANAGER to NEW-VAL.

Package

weft.

Source

weft.lisp.

Methods
Method: (setf task-shutdown-p) ((manager threaded-task-manager) (task-id symbol))
Generic Reader: tasks (object)
Package

weft.

Methods
Reader Method: tasks ((threaded-task-manager threaded-task-manager))

automatically generated reader method

Source

weft.lisp.

Target Slot

tasks.

Generic Writer: (setf tasks) (object)
Package

weft.

Methods
Writer Method: (setf tasks) ((threaded-task-manager threaded-task-manager))

automatically generated writer method

Source

weft.lisp.

Target Slot

tasks.


5.2.4 Conditions

Condition: task-exists-error

Error thrown when a task with a particular ID already exists.

Package

weft.

Source

weft.lisp.

Direct superclasses

condition.

Direct methods
Direct slots
Slot: id
Initargs

:id

Readers

task-id.

Writers

(setf task-id).


5.2.5 Structures

Structure: ref
Package

weft.

Source

weft.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: val
Readers

%ref-val.

Writers

(setf %ref-val).

Slot: lock
Initform

(bordeaux-threads:make-lock)

Readers

%ref-lock.

Writers

(setf %ref-lock).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
A   C   F   G   I   M   P   R   S   T  
Index Entry  Section

%
%ref-lock: Private ordinary functions
%ref-val: Private ordinary functions

(
(setf %ref-lock): Private ordinary functions
(setf %ref-val): Private ordinary functions
(setf manager): Private generic functions
(setf manager): Private generic functions
(setf ref-val): Private ordinary functions
(setf server-acceptor-task): Private generic functions
(setf server-acceptor-task): Private generic functions
(setf server-address): Public generic functions
(setf server-address): Public generic functions
(setf server-connection-handler): Public generic functions
(setf server-connection-handler): Public generic functions
(setf server-handler-args): Private generic functions
(setf server-handler-args): Private generic functions
(setf server-port): Public generic functions
(setf server-port): Public generic functions
(setf server-socket): Public generic functions
(setf server-socket): Public generic functions
(setf server-task-manager): Public generic functions
(setf server-task-manager): Public generic functions
(setf shutdown-vars): Private generic functions
(setf shutdown-vars): Private generic functions
(setf task-count): Private generic functions
(setf task-count): Private generic functions
(setf task-id): Private generic functions
(setf task-id): Private generic functions
(setf task-limit): Private generic functions
(setf task-limit): Private generic functions
(setf task-shutdown-p): Private generic functions
(setf task-shutdown-p): Private generic functions
(setf tasks): Private generic functions
(setf tasks): Private generic functions

A
acceptor-func: Private ordinary functions
add-task: Public generic functions
add-task: Public generic functions
all-tasks: Public generic functions
all-tasks: Public generic functions

C
connection-handler-func: Private ordinary functions
copy-ref: Private ordinary functions

F
find-task: Public generic functions
find-task: Public generic functions
Function, %ref-lock: Private ordinary functions
Function, %ref-val: Private ordinary functions
Function, (setf %ref-lock): Private ordinary functions
Function, (setf %ref-val): Private ordinary functions
Function, (setf ref-val): Private ordinary functions
Function, acceptor-func: Private ordinary functions
Function, connection-handler-func: Private ordinary functions
Function, copy-ref: Private ordinary functions
Function, gen-id: Private ordinary functions
Function, make-ref: Private ordinary functions
Function, prompt-for: Private ordinary functions
Function, ref-p: Private ordinary functions
Function, ref-val: Private ordinary functions
Function, size-of: Private ordinary functions

G
gen-id: Private ordinary functions
Generic Function, (setf manager): Private generic functions
Generic Function, (setf server-acceptor-task): Private generic functions
Generic Function, (setf server-address): Public generic functions
Generic Function, (setf server-connection-handler): Public generic functions
Generic Function, (setf server-handler-args): Private generic functions
Generic Function, (setf server-port): Public generic functions
Generic Function, (setf server-socket): Public generic functions
Generic Function, (setf server-task-manager): Public generic functions
Generic Function, (setf shutdown-vars): Private generic functions
Generic Function, (setf task-count): Private generic functions
Generic Function, (setf task-id): Private generic functions
Generic Function, (setf task-limit): Private generic functions
Generic Function, (setf task-shutdown-p): Private generic functions
Generic Function, (setf tasks): Private generic functions
Generic Function, add-task: Public generic functions
Generic Function, all-tasks: Public generic functions
Generic Function, find-task: Public generic functions
Generic Function, manager: Private generic functions
Generic Function, max-connections: Private generic functions
Generic Function, remove-task: Public generic functions
Generic Function, run: Public generic functions
Generic Function, server-acceptor-task: Private generic functions
Generic Function, server-address: Public generic functions
Generic Function, server-connection-handler: Public generic functions
Generic Function, server-handler-args: Private generic functions
Generic Function, server-port: Public generic functions
Generic Function, server-socket: Public generic functions
Generic Function, server-task-manager: Public generic functions
Generic Function, shutdown-vars: Private generic functions
Generic Function, slots-available-p: Public generic functions
Generic Function, stop: Public generic functions
Generic Function, stop-accepting: Public generic functions
Generic Function, stop-task: Public generic functions
Generic Function, task-count: Private generic functions
Generic Function, task-id: Private generic functions
Generic Function, task-limit: Private generic functions
Generic Function, task-lock: Private generic functions
Generic Function, task-shutdown-p: Private generic functions
Generic Function, tasks: Private generic functions

I
initialize-instance: Public standalone methods

M
make-ref: Private ordinary functions
manager: Private generic functions
manager: Private generic functions
max-connections: Private generic functions
max-connections: Private generic functions
Method, (setf manager): Private generic functions
Method, (setf server-acceptor-task): Private generic functions
Method, (setf server-address): Public generic functions
Method, (setf server-connection-handler): Public generic functions
Method, (setf server-handler-args): Private generic functions
Method, (setf server-port): Public generic functions
Method, (setf server-socket): Public generic functions
Method, (setf server-task-manager): Public generic functions
Method, (setf shutdown-vars): Private generic functions
Method, (setf task-count): Private generic functions
Method, (setf task-id): Private generic functions
Method, (setf task-limit): Private generic functions
Method, (setf task-shutdown-p): Private generic functions
Method, (setf tasks): Private generic functions
Method, add-task: Public generic functions
Method, all-tasks: Public generic functions
Method, find-task: Public generic functions
Method, initialize-instance: Public standalone methods
Method, manager: Private generic functions
Method, max-connections: Private generic functions
Method, remove-task: Public generic functions
Method, run: Public generic functions
Method, server-acceptor-task: Private generic functions
Method, server-address: Public generic functions
Method, server-connection-handler: Public generic functions
Method, server-handler-args: Private generic functions
Method, server-port: Public generic functions
Method, server-socket: Public generic functions
Method, server-task-manager: Public generic functions
Method, shutdown-vars: Private generic functions
Method, slots-available-p: Public generic functions
Method, stop: Public generic functions
Method, stop-accepting: Public generic functions
Method, stop-task: Public generic functions
Method, task-count: Private generic functions
Method, task-id: Private generic functions
Method, task-limit: Private generic functions
Method, task-lock: Private generic functions
Method, task-shutdown-p: Private generic functions
Method, tasks: Private generic functions

P
prompt-for: Private ordinary functions

R
ref-p: Private ordinary functions
ref-val: Private ordinary functions
remove-task: Public generic functions
remove-task: Public generic functions
run: Public generic functions
run: Public generic functions

S
server-acceptor-task: Private generic functions
server-acceptor-task: Private generic functions
server-address: Public generic functions
server-address: Public generic functions
server-connection-handler: Public generic functions
server-connection-handler: Public generic functions
server-handler-args: Private generic functions
server-handler-args: Private generic functions
server-port: Public generic functions
server-port: Public generic functions
server-socket: Public generic functions
server-socket: Public generic functions
server-task-manager: Public generic functions
server-task-manager: Public generic functions
shutdown-vars: Private generic functions
shutdown-vars: Private generic functions
size-of: Private ordinary functions
slots-available-p: Public generic functions
slots-available-p: Public generic functions
stop: Public generic functions
stop: Public generic functions
stop-accepting: Public generic functions
stop-accepting: Public generic functions
stop-task: Public generic functions
stop-task: Public generic functions

T
task-count: Private generic functions
task-count: Private generic functions
task-id: Private generic functions
task-id: Private generic functions
task-limit: Private generic functions
task-limit: Private generic functions
task-lock: Private generic functions
task-lock: Private generic functions
task-shutdown-p: Private generic functions
task-shutdown-p: Private generic functions
tasks: Private generic functions
tasks: Private generic functions