The cl-server-manager Reference Manual
Table of Contents
The cl-server-manager Reference Manual
This is the cl-server-manager Reference Manual, version 0.1,
generated automatically by Declt version 3.0 "Montgomery Scott"
on Tue Dec 22 12:47:51 2020 GMT+0.
1 Introduction
Common Lisp port-based server manager
Summary
Manage port-based Common Lisp servers (e.g., Swank and Hunchentoot) through a unified interface.
Purpose
Manage multiple instances of port-based servers through a unified interface. This is helpful if you want to quickly incorporate a console and a web server into your Common Lisp application. Swank is useful in providing an interactive interface to your application.
Quick setup (SBCL on Linux as example, YMMV)
mkdir -p $HOME/.config/common-lisp/source-registry.conf.d/50-hacking.conf
echo '(:tree (:home "hacking/common-lisp/"))' > $HOME/.config/common-lisp/source-registry.conf.d/50-hacking.conf
mkdir -p $HOME/hacking/common-lisp
cd $HOME/hacking/common-lisp
git clone https://github.com/pw4ever/cl-server-manager
-
To quickly launch it, use the provided Shell script $HOME/hacking/common-lisp/cl-server-manager/00-start-server.sh
. It loads the package (with the help of Quicklisp) and drops into prepl (portable REPL).
-
An example session inside REPL.
CL-USER> (ql:quickload :cl-server-manager) ; use Quicklisp to load CL-SERVER-MANAGER
To load "cl-server-manager":
Load 1 ASDF system:
cl-server-manager
; Loading "cl-server-manager"
........
(:CL-SERVER-MANAGER)
CL-USER> (in-package :cl-server-manager) ; save us from tying the package prefix
#<PACKAGE "CL-SERVER-MANAGER">
CL-SERVER-MANAGER> (launch-system-with-defaults nil :console :http) ; launch the console (Swank) and HTTP (Hunchentoot) servers
(36325 #<HUNCHENTOOT:ACCEPTOR (host *, port 8085)>)
CL-SERVER-MANAGER> (list-servers) ; Which servers are available?
(:CONSOLE :HTTP)
CL-SERVER-MANAGER> (list-ports :name :console) ; which port the console server is using? now we can "slime-connect" to "127.0.0.1" with port "36325" to connect to this Lisp image
(36325)
CL-SERVER-MANAGER> (list-ports :name :http) ; which port the HTTP server is using? direct your browser to http://localhost:8085
(8085)
CL-SERVER-MANAGER> (shutdown-server :name :http) ; shutdown the HTTP server
(NIL)
CL-SERVER-MANAGER> (shutdown-all-servers) ; quickly shutdown all servers
((T))
CL-SERVER-MANAGER>
tips
-
SLIME's documentation facility (especially "slime-apropos-package" with keymap "C-c C-d p") helps understanding the user interface.
-
Alternatively, take a look at the export list of "package.lisp."
2 Systems
The main system appears first, followed by any subsystem dependency.
2.1 cl-server-manager
- Author
Wei Peng <write.to.peng.wei@gmail.com>
- License
MIT
- Description
Manage port-based servers (e.g., Swank and Hunchentoot) through a unified interface.
- Version
0.1
- Dependencies
- alexandria
- swank
- hunchentoot
- prepl
- Source
cl-server-manager.asd (file)
- Components
-
3 Modules
Modules are listed depth-first from the system components tree.
3.1 cl-server-manager/types
- Dependency
util.lisp (file)
- Parent
cl-server-manager (system)
- Location
types/
- Components
-
3.2 cl-server-manager/vendors
- Dependency
types (module)
- Parent
cl-server-manager (system)
- Location
vendors/
- Components
-
4 Files
Files are sorted by type and then listed depth-first from the systems
components trees.
4.1 Lisp
4.1.1 cl-server-manager.asd
- Location
cl-server-manager.asd
- Systems
cl-server-manager (system)
4.1.2 cl-server-manager/package.lisp
- Parent
cl-server-manager (system)
- Location
package.lisp
- Packages
cl-server-manager
4.1.3 cl-server-manager/manager.lisp
- Dependency
package.lisp (file)
- Parent
cl-server-manager (system)
- Location
manager.lisp
- Exported Definitions
-
- Internal Definitions
-
4.1.4 cl-server-manager/util.lisp
- Dependency
manager.lisp (file)
- Parent
cl-server-manager (system)
- Location
util.lisp
- Exported Definitions
-
4.1.5 cl-server-manager/types/console.lisp
- Parent
types (module)
- Location
types/console.lisp
- Exported Definitions
server-console (class)
4.1.6 cl-server-manager/types/http.lisp
- Parent
types (module)
- Location
types/http.lisp
- Exported Definitions
server-http (class)
4.1.7 cl-server-manager/types/https.lisp
- Parent
types (module)
- Location
types/https.lisp
- Exported Definitions
server-https (class)
4.1.8 cl-server-manager/vendors/swank.lisp
- Parent
vendors (module)
- Location
vendors/swank.lisp
- Exported Definitions
-
- Internal Definitions
-
4.1.9 cl-server-manager/vendors/hunchentoot.lisp
- Parent
vendors (module)
- Location
vendors/hunchentoot.lisp
- Exported Definitions
-
5 Packages
Packages are listed by definition order.
5.1 cl-server-manager
- Source
package.lisp (file)
- Use List
-
- Exported Definitions
-
- Internal Definitions
-
6 Definitions
Definitions are sorted by export status, category, package, and then by
lexicographic order.
6.1 Exported definitions
6.1.1 Functions
- Function: find-port &key NAME PORT &allow-other-keys
-
Find PORT of server with NAME.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: find-server &key NAME &allow-other-keys
-
Find a server with NAME.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: launch-system-with-defaults START-REPL-P &rest SERVER-TYPES
-
Load the SERVER-TYPES with defaults; launch REPL if START-REPL-P.
- Package
cl-server-manager
- Source
util.lisp (file)
- Function: list-ports &key NAME &allow-other-keys
-
List ports of the server with NAME.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: list-server-types ()
-
List all server types.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: list-server-vendors ()
-
List registered server vendors.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: list-servers ()
-
List all server names.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: register-server-vendor-by-type SERVER-TYPE VENDOR VENDOR-INFO
-
Register server vendor by type.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: remove-port &key NAME PORT &allow-other-keys
-
Remove PORT of server with NAME.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: remove-server &key NAME &allow-other-keys
-
Remove a server with NAME.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: shutdown-all-servers ()
-
Shutdown all servers.
- Package
cl-server-manager
- Source
util.lisp (file)
- Function: shutdown-server &key NAME &allow-other-keys
-
Stop all PORTS of the server with NAME and remove it; return the STOP result for the PORTS.
- Package
cl-server-manager
- Source
manager.lisp (file)
6.1.2 Generic functions
- Generic Function: make-server SERVER-CLASS &rest ARGS &key NAME &allow-other-keys
-
Make a server of SERVER-CLASS with a given NAME.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Methods
- Method: make-server SERVER-CLASS &rest ARGS &key NAME &allow-other-keys
-
- Generic Function: query SERVER PORT &rest ARGS &key &allow-other-keys
-
Query PORT of SERVER.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Methods
- Method: query (SERVER hunchentoot) (PORT integer) &rest ARGS &key &allow-other-keys
-
- Source
hunchentoot.lisp (file)
- Method: query (SERVER swank) (PORT integer) &rest ARGS &key &allow-other-keys
-
- Source
swank.lisp (file)
- Generic Function: start SERVER PORT &rest ARGS &key ACCEPTOR-CLASS &allow-other-keys
-
Start PORT of SERVER.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Methods
- Method: start (SERVER hunchentoot) (PORT integer) &rest ARGS &key ACCEPTOR-CLASS &allow-other-keys
-
- Source
hunchentoot.lisp (file)
- Method: start (SERVER swank) (PORT integer) &rest ARGS &key &allow-other-keys
-
- Source
swank.lisp (file)
- Method: start (SERVER server) PORT &rest ARGS &key &allow-other-keys around
-
Prevent double start.
- Method: start (SERVER (eql nil)) PORT &rest ARGS &key &allow-other-keys around
-
Prevent nil start.
- Generic Function: stop SERVER PORT &rest ARGS &key &allow-other-keys
-
Stop PORT of SERVER.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Methods
- Method: stop (SERVER hunchentoot) (PORT integer) &rest ARGS &key &allow-other-keys
-
- Source
hunchentoot.lisp (file)
- Method: stop (SERVER swank) (PORT integer) &rest ARGS &key &allow-other-keys
-
- Source
swank.lisp (file)
- Method: stop (SERVER server) PORT &rest ARGS &key &allow-other-keys around
-
Prevent double stop.
- Method: stop (SERVER (eql nil)) PORT &rest ARGS &key &allow-other-keys around
-
Prevent nil stop.
6.1.3 Classes
- Class: hunchentoot ()
-
- Package
cl-server-manager
- Source
hunchentoot.lisp (file)
- Direct superclasses
-
- Direct methods
-
- Class: server ()
-
- Package
cl-server-manager
- Source
manager.lisp (file)
- Direct superclasses
standard-object (class)
- Direct subclasses
-
- Direct methods
-
- Direct slots
- Slot: name
-
Server instance name.
- Initargs
:name
- Readers
server-name (generic function)
- Writers
(setf server-name) (generic function)
- Slot: ports
-
Client interface.
- Initform
(make-hash-table :test (quote equal))
- Readers
server-ports (generic function)
- Writers
(setf server-ports) (generic function)
- Class: server-console ()
-
- Package
cl-server-manager
- Source
console.lisp (file)
- Direct superclasses
server (class)
- Direct subclasses
swank (class)
- Class: server-http ()
-
- Package
cl-server-manager
- Source
http.lisp (file)
- Direct superclasses
server (class)
- Direct subclasses
hunchentoot (class)
- Class: server-https ()
-
- Package
cl-server-manager
- Source
https.lisp (file)
- Direct superclasses
server (class)
- Direct subclasses
hunchentoot (class)
- Class: swank ()
-
- Package
cl-server-manager
- Source
swank.lisp (file)
- Direct superclasses
server-console (class)
- Direct methods
-
- Direct slots
- Slot: port-pathname
-
pathname to save port
- Initargs
:port-pathname
- Readers
port-pathname (generic function)
- Writers
(setf port-pathname) (generic function)
6.2 Internal definitions
6.2.1 Special variables
- Special Variable: *default-server-class*
-
Indexed by SERVER-TYPE.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Special Variable: *default-server-make-server-initargs*
-
Indexed by SERVER-TYPE.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Special Variable: *default-server-name*
-
Indexed by SERVER-TYPE.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Special Variable: *default-server-port*
-
Indexed by SERVER-TYPE.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Special Variable: *default-server-start-initargs*
-
Indexed by SERVER-TYPE.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Special Variable: *server-types*
-
Indexed by server TYPE.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Special Variable: *servers*
-
Indexed by server NAME.
- Package
cl-server-manager
- Source
manager.lisp (file)
6.2.2 Macros
- Macro: define-default NAME
-
Define a default system parameter with accessor.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Macro: define-defaults &rest NAMES
-
Define all default system parameters.
- Package
cl-server-manager
- Source
manager.lisp (file)
- Macro: define-server-type-with-defaults SERVER-TYPE &rest ARGS
-
Define SERVER-TYPE with defaults.
- Package
cl-server-manager
- Source
manager.lisp (file)
6.2.3 Functions
- Function: default-server-class SERVER-TYPE
-
- Function: (setf default-server-class) VALUE SERVER-TYPE
-
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: default-server-make-server-initargs SERVER-TYPE
-
- Function: (setf default-server-make-server-initargs) VALUE SERVER-TYPE
-
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: default-server-name SERVER-TYPE
-
- Function: (setf default-server-name) VALUE SERVER-TYPE
-
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: default-server-port SERVER-TYPE
-
- Function: (setf default-server-port) VALUE SERVER-TYPE
-
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: default-server-start-initargs SERVER-TYPE
-
- Function: (setf default-server-start-initargs) VALUE SERVER-TYPE
-
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: set-server-type-defaults SERVER-TYPE &key CLASS NAME MAKE-SERVER-INITARGS PORT START-INITARGS &allow-other-keys
-
- Package
cl-server-manager
- Source
manager.lisp (file)
- Function: show-server-type-defaults SERVER-TYPE
-
- Package
cl-server-manager
- Source
manager.lisp (file)
6.2.4 Generic functions
- Generic Function: port-pathname OBJECT
-
- Generic Function: (setf port-pathname) NEW-VALUE OBJECT
-
- Package
cl-server-manager
- Methods
- Method: port-pathname (SWANK swank)
-
- Method: (setf port-pathname) NEW-VALUE (SWANK swank)
-
pathname to save port
- Source
swank.lisp (file)
- Generic Function: server-name OBJECT
-
- Generic Function: (setf server-name) NEW-VALUE OBJECT
-
- Package
cl-server-manager
- Methods
- Method: server-name (SERVER server)
-
- Method: (setf server-name) NEW-VALUE (SERVER server)
-
Server instance name.
- Source
manager.lisp (file)
- Generic Function: server-ports OBJECT
-
- Generic Function: (setf server-ports) NEW-VALUE OBJECT
-
- Package
cl-server-manager
- Methods
- Method: server-ports (SERVER server)
-
- Method: (setf server-ports) NEW-VALUE (SERVER server)
-
Client interface.
- Source
manager.lisp (file)
Appendix A Indexes
A.1 Concepts
| Index Entry | | Section |
|
C | | |
| cl-server-manager.asd: | | The cl-server-manager․asd file |
| cl-server-manager/manager.lisp: | | The cl-server-manager/manager․lisp file |
| cl-server-manager/package.lisp: | | The cl-server-manager/package․lisp file |
| cl-server-manager/types: | | The cl-server-manager/types module |
| cl-server-manager/types/console.lisp: | | The cl-server-manager/types/console․lisp file |
| cl-server-manager/types/http.lisp: | | The cl-server-manager/types/http․lisp file |
| cl-server-manager/types/https.lisp: | | The cl-server-manager/types/https․lisp file |
| cl-server-manager/util.lisp: | | The cl-server-manager/util․lisp file |
| cl-server-manager/vendors: | | The cl-server-manager/vendors module |
| cl-server-manager/vendors/hunchentoot.lisp: | | The cl-server-manager/vendors/hunchentoot․lisp file |
| cl-server-manager/vendors/swank.lisp: | | The cl-server-manager/vendors/swank․lisp file |
|
F | | |
| File, Lisp, cl-server-manager.asd: | | The cl-server-manager․asd file |
| File, Lisp, cl-server-manager/manager.lisp: | | The cl-server-manager/manager․lisp file |
| File, Lisp, cl-server-manager/package.lisp: | | The cl-server-manager/package․lisp file |
| File, Lisp, cl-server-manager/types/console.lisp: | | The cl-server-manager/types/console․lisp file |
| File, Lisp, cl-server-manager/types/http.lisp: | | The cl-server-manager/types/http․lisp file |
| File, Lisp, cl-server-manager/types/https.lisp: | | The cl-server-manager/types/https․lisp file |
| File, Lisp, cl-server-manager/util.lisp: | | The cl-server-manager/util․lisp file |
| File, Lisp, cl-server-manager/vendors/hunchentoot.lisp: | | The cl-server-manager/vendors/hunchentoot․lisp file |
| File, Lisp, cl-server-manager/vendors/swank.lisp: | | The cl-server-manager/vendors/swank․lisp file |
|
L | | |
| Lisp File, cl-server-manager.asd: | | The cl-server-manager․asd file |
| Lisp File, cl-server-manager/manager.lisp: | | The cl-server-manager/manager․lisp file |
| Lisp File, cl-server-manager/package.lisp: | | The cl-server-manager/package․lisp file |
| Lisp File, cl-server-manager/types/console.lisp: | | The cl-server-manager/types/console․lisp file |
| Lisp File, cl-server-manager/types/http.lisp: | | The cl-server-manager/types/http․lisp file |
| Lisp File, cl-server-manager/types/https.lisp: | | The cl-server-manager/types/https․lisp file |
| Lisp File, cl-server-manager/util.lisp: | | The cl-server-manager/util․lisp file |
| Lisp File, cl-server-manager/vendors/hunchentoot.lisp: | | The cl-server-manager/vendors/hunchentoot․lisp file |
| Lisp File, cl-server-manager/vendors/swank.lisp: | | The cl-server-manager/vendors/swank․lisp file |
|
M | | |
| Module, cl-server-manager/types: | | The cl-server-manager/types module |
| Module, cl-server-manager/vendors: | | The cl-server-manager/vendors module |
|
A.2 Functions
| Index Entry | | Section |
|
( | | |
| (setf default-server-class) : | | Internal functions |
| (setf default-server-make-server-initargs) : | | Internal functions |
| (setf default-server-name) : | | Internal functions |
| (setf default-server-port) : | | Internal functions |
| (setf default-server-start-initargs) : | | Internal functions |
| (setf port-pathname) : | | Internal generic functions |
| (setf port-pathname) : | | Internal generic functions |
| (setf server-name) : | | Internal generic functions |
| (setf server-name) : | | Internal generic functions |
| (setf server-ports) : | | Internal generic functions |
| (setf server-ports) : | | Internal generic functions |
|
D | | |
| default-server-class : | | Internal functions |
| default-server-make-server-initargs : | | Internal functions |
| default-server-name : | | Internal functions |
| default-server-port : | | Internal functions |
| default-server-start-initargs : | | Internal functions |
| define-default : | | Internal macros |
| define-defaults : | | Internal macros |
| define-server-type-with-defaults : | | Internal macros |
|
F | | |
| find-port : | | Exported functions |
| find-server : | | Exported functions |
| Function, (setf default-server-class) : | | Internal functions |
| Function, (setf default-server-make-server-initargs) : | | Internal functions |
| Function, (setf default-server-name) : | | Internal functions |
| Function, (setf default-server-port) : | | Internal functions |
| Function, (setf default-server-start-initargs) : | | Internal functions |
| Function, default-server-class : | | Internal functions |
| Function, default-server-make-server-initargs : | | Internal functions |
| Function, default-server-name : | | Internal functions |
| Function, default-server-port : | | Internal functions |
| Function, default-server-start-initargs : | | Internal functions |
| Function, find-port : | | Exported functions |
| Function, find-server : | | Exported functions |
| Function, launch-system-with-defaults : | | Exported functions |
| Function, list-ports : | | Exported functions |
| Function, list-server-types : | | Exported functions |
| Function, list-server-vendors : | | Exported functions |
| Function, list-servers : | | Exported functions |
| Function, register-server-vendor-by-type : | | Exported functions |
| Function, remove-port : | | Exported functions |
| Function, remove-server : | | Exported functions |
| Function, set-server-type-defaults : | | Internal functions |
| Function, show-server-type-defaults : | | Internal functions |
| Function, shutdown-all-servers : | | Exported functions |
| Function, shutdown-server : | | Exported functions |
|
G | | |
| Generic Function, (setf port-pathname) : | | Internal generic functions |
| Generic Function, (setf server-name) : | | Internal generic functions |
| Generic Function, (setf server-ports) : | | Internal generic functions |
| Generic Function, make-server : | | Exported generic functions |
| Generic Function, port-pathname : | | Internal generic functions |
| Generic Function, query : | | Exported generic functions |
| Generic Function, server-name : | | Internal generic functions |
| Generic Function, server-ports : | | Internal generic functions |
| Generic Function, start : | | Exported generic functions |
| Generic Function, stop : | | Exported generic functions |
|
L | | |
| launch-system-with-defaults : | | Exported functions |
| list-ports : | | Exported functions |
| list-server-types : | | Exported functions |
| list-server-vendors : | | Exported functions |
| list-servers : | | Exported functions |
|
M | | |
| Macro, define-default : | | Internal macros |
| Macro, define-defaults : | | Internal macros |
| Macro, define-server-type-with-defaults : | | Internal macros |
| make-server : | | Exported generic functions |
| make-server : | | Exported generic functions |
| Method, (setf port-pathname) : | | Internal generic functions |
| Method, (setf server-name) : | | Internal generic functions |
| Method, (setf server-ports) : | | Internal generic functions |
| Method, make-server : | | Exported generic functions |
| Method, port-pathname : | | Internal generic functions |
| Method, query : | | Exported generic functions |
| Method, query : | | Exported generic functions |
| Method, server-name : | | Internal generic functions |
| Method, server-ports : | | Internal generic functions |
| Method, start : | | Exported generic functions |
| Method, start : | | Exported generic functions |
| Method, start : | | Exported generic functions |
| Method, start : | | Exported generic functions |
| Method, stop : | | Exported generic functions |
| Method, stop : | | Exported generic functions |
| Method, stop : | | Exported generic functions |
| Method, stop : | | Exported generic functions |
|
P | | |
| port-pathname : | | Internal generic functions |
| port-pathname : | | Internal generic functions |
|
Q | | |
| query : | | Exported generic functions |
| query : | | Exported generic functions |
| query : | | Exported generic functions |
|
R | | |
| register-server-vendor-by-type : | | Exported functions |
| remove-port : | | Exported functions |
| remove-server : | | Exported functions |
|
S | | |
| server-name : | | Internal generic functions |
| server-name : | | Internal generic functions |
| server-ports : | | Internal generic functions |
| server-ports : | | Internal generic functions |
| set-server-type-defaults : | | Internal functions |
| show-server-type-defaults : | | Internal functions |
| shutdown-all-servers : | | Exported functions |
| shutdown-server : | | Exported functions |
| start : | | Exported generic functions |
| start : | | Exported generic functions |
| start : | | Exported generic functions |
| start : | | Exported generic functions |
| start : | | Exported generic functions |
| stop : | | Exported generic functions |
| stop : | | Exported generic functions |
| stop : | | Exported generic functions |
| stop : | | Exported generic functions |
| stop : | | Exported generic functions |
|
A.3 Variables
| Index Entry | | Section |
|
* | | |
| *default-server-class* : | | Internal special variables |
| *default-server-make-server-initargs* : | | Internal special variables |
| *default-server-name* : | | Internal special variables |
| *default-server-port* : | | Internal special variables |
| *default-server-start-initargs* : | | Internal special variables |
| *server-types* : | | Internal special variables |
| *servers* : | | Internal special variables |
|
N | | |
| name : | | Exported classes |
|
P | | |
| port-pathname : | | Exported classes |
| ports : | | Exported classes |
|
S | | |
| Slot, name : | | Exported classes |
| Slot, port-pathname : | | Exported classes |
| Slot, ports : | | Exported classes |
| Special Variable, *default-server-class* : | | Internal special variables |
| Special Variable, *default-server-make-server-initargs* : | | Internal special variables |
| Special Variable, *default-server-name* : | | Internal special variables |
| Special Variable, *default-server-port* : | | Internal special variables |
| Special Variable, *default-server-start-initargs* : | | Internal special variables |
| Special Variable, *server-types* : | | Internal special variables |
| Special Variable, *servers* : | | Internal special variables |
|
A.4 Data types