Is ZEO my friend...
Hi zopistas, Here's the future problem... A web app records "todo" tasks into a queue. The queue will be a folderish, the "todo" task will be file like objects with properties saying what to do with. Then a background process will read that queue in a loop, remove "todo" tasks 1 per one, the oldest first and start processing accordingly. What about using a ZEO client app for this kind of console python app ? As ZODB is transactional, ther should not be read/write conflicts on objects ? If I'm in the good direction, are there some examples or tutorials using that specific architecture ? Thanks in advance. -- Gilles
On Fri, Jan 10, 2003 at 01:42:40AM +0100, Gilles Lenfant wrote:
Hi zopistas,
Here's the future problem...
A web app records "todo" tasks into a queue. The queue will be a folderish, the "todo" task will be file like objects with properties saying what to do with.
Then a background process will read that queue in a loop, remove "todo" tasks 1 per one, the oldest first and start processing accordingly.
What about using a ZEO client app for this kind of console python app ?
the background process you mean? sounds fine.
As ZODB is transactional, ther should not be read/write conflicts on objects ?
just sync on boundaries and you'll usually be OK, but you will probably need to catch e.g. writeConflictError and decide whether to re-try the transaction or what. Note that I haven't actually written an app like this but AFAIK that's all there is to it.
If I'm in the good direction, are there some examples or tutorials using that specific architecture ?
playing around in an interactive debugging session should give you the idea... getting started is very easy: import Zope app = Zope.app() todo_folder = app.path.to.my.todo_folder ... # save changes get_transaction().commit() # load other clients' changes app._p_jar.sync() # abort a transaction get_transaction().abort() -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's THE GUTS! (random hero from isometric.spaceninja.com)
participants (2)
-
Gilles Lenfant -
Paul Winkler