Common Lisp Package: CLACK

# Clack main package just for convenience. ## SYNOPSIS (clackup (lambda (env) (declare (ignore env)) '(200 nil ("Hello, Clack!"))) :port 5000 :debug t) (clackup #p"app.lisp" :server :fcgi :port 8080 :debug nil) ## DESCRIPTION Contrary to your expectations, this package is not so significant. Just exporting symbols imported from Clack.Component and Clack.Middleware. This package is mostly just here to avoid confusion, especially for beginners. Most peaple expect there to be a package that has the same as asdf:system. Worthy of special mention is `clackup'. It provides an easy way to run Clack Applications. ## AUTHOR * Eitarow Fukamachi (e.arrows@gmail.com) ## SEE ALSO * Clack.Component * Clack.Middleware

README:

FUNCTION

Public

CLACKUP (APP &REST ARGS &KEY (SERVER HUNCHENTOOT) (PORT 5000) (DEBUG T))

Easy way to run Clack Application. You can specify backend server with passing `:server'. The default is `:hunchentoot'. Example: (clackup (lambda (env) (declare (ignore env)) '(200 nil ("ok"))) :port 5000 :debug t) (clackup #p"app.lisp" :server :fcgi :port 8080 :debug nil)

Private

APPLY-MIDDLEWARE (APP MW-CLASS-NAME MW-PACKAGE &REST ARGS)

Apply a middleware to the `app'. This function is for resolving symbol packages in run-time.

EVAL-FILE (FILE)

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

FIND-HANDLER (SERVER &KEY (FORCE T))

Return a handler package. `server` must be a symbol or a keyword, not containing "Clack.Handler." as a prefix. Example: (find-handler :hunchentoot)

LOAD-HANDLER (SERVER)

Load a handler system in run-time. `server` must be a symbol or a keyword. Example: (load-handler :hunchentoot)

MAKE-THREAD (FUNCTION &KEY NAME (INITIAL-BINDINGS *DEFAULT-SPECIAL-BINDINGS*))

Creates and returns a thread named NAME, which will call the function FUNCTION with no arguments: when FUNCTION returns, the thread terminates. NAME defaults to "Anonymous thread" if unsupplied. On systems that do not support multi-threading, MAKE-THREAD will signal an error. The interaction between threads and dynamic variables is in some cases complex, and depends on whether the variable has only a global binding (as established by e.g. DEFVAR/DEFPARAMETER/top-level SETQ) or has been bound locally (e.g. with LET or LET*) in the calling thread. - Global bindings are shared between threads: the initial value of a global variable in the new thread will be the same as in the parent, and an assignment to such a variable in any thread will be visible to all threads in which the global binding is visible. - Local bindings, such as the ones introduced by INITIAL-BINDINGS, are local to the thread they are introduced in, except that - Local bindings in the the caller of MAKE-THREAD may or may not be shared with the new thread that it creates: this is implementation-defined. Portable code should not depend on particular behaviour in this case, nor should it assign to such variables without first rebinding them in the new thread.

THREAD-ALIVE-P (THREAD)

Returns true if THREAD is alive, that is, if DESTROY-THREAD has not been called on it.

Undocumented

SLURP-STREAM-TO-STRING (STREAM &KEY (EXTERNAL-FORMAT LATIN1))

GENERIC-FUNCTION

Public

CALL (COMP ENV)

Invoke component. Designed to be overriden in subclasses.

Undocumented

CALL-NEXT (THIS ENV)

MAKE-APP (COMP)

STOP (THIS)

WRAP (THIS APP-OR-MIDDLEWARE)

VARIABLE

Public

*CLACK-OUTPUT*

Standard output for a Clack running process. This variable will be used in `<clack-middleware-stdout>'.

CLASS

Public

<COMPONENT>

Base Class for Clack Component shared between <middleware> and Clack Application.

<MIDDLEWARE>

Class for Clack Middleware.

Private

Undocumented

<HANDLER>