The clack Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The clack Reference Manual

This is the clack Reference Manual, version 2.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Sep 15 04:19:56 2022 GMT+0.

Table of Contents


1 Introduction

Clack - Web Application Environment for Common Lisp

Build Status Coverage Status Quicklisp dist

Clack is a web application environment for Common Lisp inspired by Python's WSGI and Ruby's Rack.

Usage

(defvar *handler*
    (clack:clackup
      (lambda (env)
        (declare (ignore env))
        '(200 (:content-type "text/plain") ("Hello, Clack!")))))

Open your web browser and go to http://localhost:5000/. You should get "Hello, Clack!".

To stop the server, use (clack:stop *handler*).

Command-line interface

Clack provides a script to start a web server. It's useful when you deploy to production environment.

NOTE: Install Roswell before as it depends on it.

When you execute ros install clack, it copies clackup script to $HOME/.roswell/bin. Make sure the path is in your shell $PATH.

$ ros install clack
$ which clackup
/Users/nitro_idiot/.roswell/bin/clackup

$ cat <<EOF >> app.lisp
(lambda (env)
  (declare (ignore env))
  '(200 (:content-type "text/plain") ("Hello, Clack!")))
EOF
$ clackup app.lisp
Hunchentoot server is started.
Listening on localhost:5000.

Installation

(ql:quickload :clack)

Documentation

Server

How to contribute

See CONTRIBUTING.md.

See Also

Author

Copyright

Copyright (c) 2011-2015 Eitaro Fukamachi & contributors

License

Licensed under the LLGPL License.


2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 clack

Web application environment for Common Lisp

Author

Eitaro Fukamachi

License

LLGPL

Long Description

# Clack - Web Application Environment for Common Lisp

[![Build Status](https://travis-ci.org/fukamachi/clack.svg?branch=master)](https://travis-ci.org/fukamachi/clack)
[![Coverage Status](https://coveralls.io/repos/fukamachi/clack/badge.svg?branch=master)](https://coveralls.io/r/fukamachi/clack) [![Quicklisp dist](http://quickdocs.org/badge/clack.svg)](http://quickdocs.org/clack/)

Clack is a web application environment for Common Lisp inspired by Python’s WSGI and Ruby’s Rack.

## Usage

“‘common-lisp
(defvar *handler*
(clack:clackup
(lambda (env)
(declare (ignore env))
’(200 (:content-type "text/plain") ("Hello, Clack!")))))
“‘

Open your web browser and go to [http://localhost:5000/](http://localhost:5000/). You should get "Hello, Clack!".

To stop the server, use ‘(clack:stop *handler*)‘.

## Command-line interface

Clack provides a script to start a web server. It’s useful when you deploy to production environment.

NOTE: Install [Roswell](https://github.com/snmsts/roswell) before as it depends on it.

When you execute ‘ros install clack‘, it copies ‘clackup‘ script to ‘$HOME/.roswell/bin‘. Make sure the path is in your shell ‘$PATH‘.

$ ros install clack
$ which clackup
/Users/nitro_idiot/.roswell/bin/clackup

$ cat <<EOF >> app.lisp
(lambda (env)
(declare (ignore env))
’(200 (:content-type "text/plain") ("Hello, Clack!")))
EOF
$ clackup app.lisp
Hunchentoot server is started.
Listening on localhost:5000.

## Installation

“‘common-lisp
(ql:quickload :clack)
“‘

## Documentation

- [Quickdocs Page](http://quickdocs.org/clack/)

## Server

* [Hunchentoot](http://weitz.de/hunchentoot/)
* [FastCGI](http://www.fastcgi.com/)
* [Wookie](http://wookie.beeets.com/)
* [Toot](https://github.com/gigamonkey/toot)
* [Woo](https://github.com/fukamachi/woo)

## How to contribute

See [CONTRIBUTING.md](CONTRIBUTING.md).

## See Also

* [Lack](https://github.com/fukamachi/lack): Clack application builder

## Author

* Eitaro Fukamachi (e.arrows@gmail.com)

## Copyright

Copyright (c) 2011-2015 Eitaro Fukamachi & [contributors](https://github.com/fukamachi/clack/graphs/contributors)

## License

Licensed under the LLGPL License.

Version

2.0.0

Dependencies
  • lack (system).
  • lack-middleware-backtrace (system).
  • lack-util (system).
  • bordeaux-threads (system).
  • usocket (system).
  • swank (system).
  • alexandria (system).
  • uiop (system).
Source

clack.asd.

Child Component

src (module).


Next: , Previous: , Up: The clack Reference Manual   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 clack/src

Source

clack.asd.

Parent Component

clack (system).

Child Components

4 Files

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


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

4.1.1 clack/clack.asd

Source

clack.asd.

Parent Component

clack (system).

ASDF Systems

clack.

Packages

clack-asd.


4.1.2 clack/src/clack.lisp

Dependencies
Source

clack.asd.

Parent Component

src (module).

Packages

clack.

Public Interface
Internals

4.1.3 clack/src/handler.lisp

Dependency

util.lisp (file).

Source

clack.asd.

Parent Component

src (module).

Packages

clack.handler.

Public Interface
Internals

Previous: , Up: Lisp   [Contents][Index]

4.1.4 clack/src/util.lisp

Source

clack.asd.

Parent Component

src (module).

Packages

clack.util.

Public Interface

find-handler (function).


5 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

5.1 clack

Source

clack.lisp.

Use List

common-lisp.

Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

5.2 clack-asd

Source

clack.asd.

Use List
  • asdf/interface.
  • common-lisp.

Next: , Previous: , Up: Packages   [Contents][Index]

5.3 clack.handler

Source

handler.lisp.

Use List

common-lisp.

Public Interface
Internals

Previous: , Up: Packages   [Contents][Index]

5.4 clack.util

Source

util.lisp.

Use List

common-lisp.

Public Interface

find-handler (function).


6 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Public Interface


6.1.1 Ordinary functions

Function: clackup (app &rest args &key server address port swank-interface swank-port debug silent use-thread use-default-middlewares &allow-other-keys)
Package

clack.

Source

clack.lisp.

Function: eval-file (file)

Safer way to read and eval a file content. This function returns the last value.

Package

clack.

Source

clack.lisp.

Function: find-handler (server)
Package

clack.util.

Source

util.lisp.

Function: run (app server &rest args &key address use-thread swank-interface swank-port &allow-other-keys)
Package

clack.handler.

Source

handler.lisp.

Function: stop (handler)
Package

clack.handler.

Source

handler.lisp.


6.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

6.2.1 Special variables

Special Variable: *app-file-cache*
Package

clack.

Source

clack.lisp.


6.2.2 Macros

Macro: with-handle-interrupt (int-handler &body body)
Package

clack.

Source

clack.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

6.2.3 Ordinary functions

Function: %load-file (file)
Package

clack.

Source

clack.lisp.

Function: copy-handler (instance)
Package

clack.handler.

Source

handler.lisp.

Reader: handler-acceptor (instance)
Writer: (setf handler-acceptor) (instance)
Package

clack.handler.

Source

handler.lisp.

Target Slot

acceptor.

Function: handler-p (object)
Package

clack.handler.

Source

handler.lisp.

Reader: handler-server (instance)
Writer: (setf handler-server) (instance)
Package

clack.handler.

Source

handler.lisp.

Target Slot

server.

Reader: handler-swank-port (instance)
Writer: (setf handler-swank-port) (instance)
Package

clack.handler.

Source

handler.lisp.

Target Slot

swank-port.

Function: make-handler (&key server swank-port acceptor)
Package

clack.handler.

Source

handler.lisp.


6.2.4 Structures

Structure: handler
Package

clack.handler.

Source

handler.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: server
Readers

handler-server.

Writers

(setf handler-server).

Slot: swank-port
Readers

handler-swank-port.

Writers

(setf handler-swank-port).

Slot: acceptor
Readers

handler-acceptor.

Writers

(setf handler-acceptor).


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   %   (  
C   E   F   H   M   R   S   W  
Index Entry  Section

%
%load-file: Private ordinary functions

(
(setf handler-acceptor): Private ordinary functions
(setf handler-server): Private ordinary functions
(setf handler-swank-port): Private ordinary functions

C
clackup: Public ordinary functions
copy-handler: Private ordinary functions

E
eval-file: Public ordinary functions

F
find-handler: Public ordinary functions
Function, %load-file: Private ordinary functions
Function, (setf handler-acceptor): Private ordinary functions
Function, (setf handler-server): Private ordinary functions
Function, (setf handler-swank-port): Private ordinary functions
Function, clackup: Public ordinary functions
Function, copy-handler: Private ordinary functions
Function, eval-file: Public ordinary functions
Function, find-handler: Public ordinary functions
Function, handler-acceptor: Private ordinary functions
Function, handler-p: Private ordinary functions
Function, handler-server: Private ordinary functions
Function, handler-swank-port: Private ordinary functions
Function, make-handler: Private ordinary functions
Function, run: Public ordinary functions
Function, stop: Public ordinary functions

H
handler-acceptor: Private ordinary functions
handler-p: Private ordinary functions
handler-server: Private ordinary functions
handler-swank-port: Private ordinary functions

M
Macro, with-handle-interrupt: Private macros
make-handler: Private ordinary functions

R
run: Public ordinary functions

S
stop: Public ordinary functions

W
with-handle-interrupt: Private macros

Jump to:   %   (  
C   E   F   H   M   R   S   W