webserver - hunchentoot session- v. thread-localized values (ccl) -


i'm using hunchentoot session values make server code re-entrant. problem session values are, definition, retained during session, i.e., 1 call same browser next, whereas looking amount thread-specific re-entrancy, values disappear between calls -- want treat each click separate "from scratch" event, if same session . easy enough have driver either set nil, or delete session values, i'm wondering if there's "correct" way this? don't see thread-based analog hunchentoot:session-value in documentation.

thanks in advance guidance can offer.

if want value "thread specific" , @ same time "from scratch" on every request, requires every request must dispatched in brand new thread. not case according hunchentoot documentation, says 2 models supported: single-threaded taskmaster , thread-per-connection taskmaster.

if configuration multi-threaded, thread-specific variable bound in request-handling can therefore expected per-connection. in single-threaded hunchentoot setup, global, tied request servicing thread.

a thread-based analog hunchentoot:session-value doesn't exist because introduce behaviors web app surprisingly change if threading model reconfigured, or if request pattern browser changes. browser can make multiple requests using same connection, or close connection between requests.

to extend request objects custom per-request, into, perhaps, subclassing acceptor (how described in docs). custom acceptor have custom method of process-connection generic function create extended/subclasses request objects carrying stuff wanted put request.

another way have global weak hash binds request objects keys additional information.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -