[Twisted-Python] twisted.persisted.journal: a prevayler-inspired persistence system

Glyph Lefkowitz glyph at twistedmatrix.com
Sun Oct 13 15:11:04 MDT 2002


On Sun, 13 Oct 2002 02:44:05 -0400, Itamar Shtull-Trauring <twisted at itamarst.org> wrote:

> Prevayler has something like that where you have Clock passed to commands,
> IIRC. I probably should add some code so commands can get a "fake" time,
> i.e. the time they were supposed to have been run. Not sure that randomness
> is worth doing - if you are using it presumably any outcome is equally valid,
> or alternatively if that's not that case you can't really use journal anyway.

Not in the case of a game: certain events have "random" outcomes, weighted
randomness based on a die roll plus some skill modifiers and so forth.  You can
still use object prevalence to persist this information, but you need the die
rolls associated with a certain action to be the same the second time through.
(IIRC in the Prevayler model, you're supposed to use a deterministic hash
ordering method so that you don't accidentally have any code that depends on
the order of a dictionary's keys, either...)

-- 
 |    <`'>    |  Glyph Lefkowitz: Travelling Sorcerer  |
 |   < _/ >   |  Lead Developer,  the Twisted project  |
 |  < ___/ >  |      http://www.twistedmatrix.com      |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20021013/b3b7238c/attachment.sig>


More information about the Twisted-Python mailing list