On 2014-03-18 14:39, Gerhard Schmidt wrote:
On 18.03.2014 14:08, Chris Rossi wrote:
It should start its own connection via the standard ZODB API.  You might
consider moving the extra work to a different process.  Redis pub/sub or
list objects are good ways to communicate and set up a primitive, simple
queue.  I prefer that to more complex queue/messaging frameworks.  YMMV.

Right now I have no ZEO running. In Production there will be a ZEO but
while developing a ZEO server simply adds to complexity and makes
debugging even more pain in the ass.

Well, really? A ZEO-Client-Server in development enables you to connect with two threads, i.e. one debugging console, one serving requests. I prefer this way of debugging. But yes - the zeoserver needs to be started, thats all. Using buildout setup/configuration is very easy.

It might solve me problem if I could start a worker thread at
application start an send the task via queue there but there is still
the problem to get a thread with access to the zodb started. I know that
it's possible to use one ZODB connection in multiple threads, Zope does
it and pyramid does it. The question is how to fork a new subconnection
or transaction and pass it to the new thread.

Using ZEO and if youre running exact one worker thread: Let the request-process(s) store the tasks in the ZODB and fetch it task by task in a worker process. Dont forget to keep transaction (begin to commit) time at both, request and worker, as short as possible to avoid database conflicts.

If you need more than one worker there are solutions around AMQP (i.e. rabbitmq) or redis helping you with queue management. I used such only with Zope2 so far, but the principle is very basic. So I'am sure it works in a pyramid environment well.

regards Jens


Regards
    Estartu



--
Klein & Partner KG, member of BlueDynamics Alliance

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to