[hunchentoot-devel] question about the dispatcher
Leslie P. Polzer
sky at viridian-project.de
Sat Aug 29 10:31:32 UTC 2009
Mackram Raydan wrote:
> so i was going through the hunchentoot documenation and I noticed that Edi
> said "Unless you are in a Lisp without MP capabilities, you can have several
> active instances of ACCEPTOR
> <http://weitz.de/hunchentoot/#acceptor>(listening on different ports)
> at the same time."
>
> Now this is great but I can not seem to understand how do you link a
> dispatcher to an acceptor (any kind of dispatcher) should the uri we put
> include a port or something. Can anyone point out this? Thanks in advance.
The default acceptor refers to *dispatch-table* to find a dispatcher
that is willing to return a handler.
To modify this behavior (e.g. have a separate table per acceptor) you need
to subclass ACCEPTOR and set the REQUEST-DISPATCHER slot to an appropriate
function:
(request-dispatcher :initarg :request-dispatcher
:accessor acceptor-request-dispatcher
:documentation "A designator for the request
dispatcher function used by this acceptor. A function which accepts a
REQUEST object and calls a request handler of its choice \(and returns
its return value). The default is the unexported symbol
LIST-REQUEST-DISPATCHER which works through the list
*DISPATCH-TABLE*.")
HTH,
Leslie
--
http://www.linkedin.com/in/polzer
More information about the Tbnl-devel
mailing list