[hunchentoot-devel] dispatcher class
Cyrus Harmon
ch-tbnl at bobobeach.com
Mon Apr 18 05:11:09 UTC 2011
Continuing my efforts to solve the problem of wanting, for instance, an SSL-accepting easy-acceptor without creating a subclass of both SSL-ACCEPTOR and EASY-ACCEPTOR, I've created a new class called DISPATCHER which implements the dispatch-request generic function. The advantage of this class is that one can add custom dispatching behavior without needing to subclass the acceptor. For instance, the EASY-ACCEPTOR is now an EASY-DISPATCHER and can be invoked as:
(hunchentoot:start
(make-instance 'hunchentoot:acceptor :port 4243
:dispatcher (make-instance 'hunchentoot:easy-dispatcher)))
New dispatching behavior can be implemented by subclassing DISPATCHER and setting the dispatcher slot of the acceptor to point to an instance of the subclass.
The changes can be found in git at:
https://github.com/slyrus/hunchentoot/tree/dispatcher
and in the attached patch.
Cyrus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hunchentoot-dispatcher.patch
Type: application/octet-stream
Size: 9516 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/tbnl-devel/attachments/20110417/e44173d8/attachment.obj>
More information about the Tbnl-devel
mailing list