Common Lisp Package: NINGLE.CONTEXT

# Ningle.Context - Managing current state for each request. ## SYNOPSIS ;; In the controller. ;; Get context object. (context) ;=> #<HASH-TABLE :TEST EQL size 0/60 #x3020025FF5FD> ;; Access to each value. (context :hoge) ;=> "Something set to :hoge." ;; Set to context (setf (context :hoge) "hogehoge") ## DESCRIPTION Ningle.Context is for managing current state for each request. It is called "Context" in Ningle. Specifically, context is a hash table in global scope. you can access it with a function `context'. See SYNOPSIS for details. ## AUTHOR * Eitarow Fukamachi (e.arrows@gmail.com)

README:

FUNCTION

Public

CONTEXT (&OPTIONAL KEY)

Access to current context. If key is specified, return the value in current context. If not, just return a current context. Example: (context) ;=> #<HASH-TABLE :TEST EQL size 0/60 #x3020025FF5FD> (context :request) ;=> #<CAVEMAN.REQUEST:<REQUEST> #x3020024FCCFD>

MAKE-CONTEXT (REQ)

Create a new Context.

Undocumented

SETFCONTEXT (VAL KEY)

Private

MAKE-REQUEST (ENV)

A synonym for (make-instance '<request> ...). Make a <request> instance from environment plist. Raw-body of the instance will be shared, meaning making an instance of <request> doesn't effect on an original raw-body.

MAKE-RESPONSE (&OPTIONAL STATUS HEADERS BODY)

A synonym for (make-instance '<response> ...). Create a <response> instance.

MACRO

Public

Undocumented

WITH-CONTEXT-VARIABLES ((&REST VARS) &BODY BODY)

VARIABLE

Public

*CONTEXT*

Special variable to store Ningle Context, a hash table. Don't set to this variable directly. This is designed to be bound in lexical let.

*REQUEST*

Special variable to store Ningle Request, a instance of `<request>' in Ningle.Request package. Don't set to this variable directly. This is designed to be bound in lexical let.

*RESPONSE*

Special variable to store Ningle Response, a instance of `<response>' in Ningle.Response package. Don't set to this variable directly. This is designed to be bound in lexical let.

*SESSION*

Special variable to store session. Don't set to this variable directly. This is designed to be bound in lexical let.