[Seaside] state in request handler

Milan Mimica milan.mimica at gmail.com
Fri Apr 13 06:13:21 UTC 2012

On 12 April 2012 23:46, Norbert Hartl <norbert at hartl.name> wrote:

> I'm using a seaside rest handler and I was wondering today how concurrency
> issues are handeld there. The request handler is a component that is always
> the same object for incoming requests. I need to set  a heavy weight
> component at incoming request and I want to have it accessible until the
> response is send. Where is the be place to put such kind of state?
> Starting to add an instance variable in the request handler I had the
> impression this is a bad thing to do. And then I was wondering how multiple
> threads are handled in seaside. Or better what operation can be considered
> thread safe and where I need to put extra effort to protect intermediate
> state while processing. My component needs to be initialized by the
> incoming request context and is accessed multiple times until process has
> finished.

You could make it thread-local. Look at how WACurrentRequestContext is

Milan Mimica
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20120413/f63c3d6c/attachment.htm

More information about the seaside mailing list