[Seaside] ThreadPool with Seaside - how?

Philippe Marschall philippe.marschall at gmail.com
Wed Jul 26 10:44:47 UTC 2017


On Wed, Jul 26, 2017 at 12:09 PM, Sabine Manaa <manaa.sabine at gmail.com> wrote:
> Hi,
>
> [1] Paul and Ramon suggested to use the ThreadPool [2] to me.
> I want to replace my forked code for generating reports with it.
>
> When trying to use it within my seaside application, I have a problem.
> I reduced the Problem to this:
>
> -> this works, a simple in inspector pops up
> html mdlButton
> onClick: (html jQuery ajax script: [ :script | [ #simple inspect ] queueWork
> ]);
> with: '0'.
>
> -> this does not work.
>
> The generation of my reports needs the sessions objects.

Most Seaside objects are not thread safe as they are meant to be used
only within the request-response thread. WASession is one of them
that's why it's normally behind a WAMutualExclusionFilter. In theory
any forked access to a session should go through that mutex. In
addition forked access to a session is not recorded in the session
cache so it may expire at any time. If you need session data in a
forked process the recommendation would be to factor that data out
into an immutable object and store with object in the session and pass
this object to the forked process.

Cheers
Philippe


More information about the seaside mailing list