[ZODB-Dev] Ordering before commit hooks

Julien Anguenot ja at nuxeo.com
Sat Aug 6 13:16:49 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tim Peters wrote:
> [Julien Anguenot]
> ...
> 
>>>The order argument could be an integer with a default value to 0 added
>>>to the registration method.
> 
> 
> [Gary Poster]
> 
>>I usually like the word 'priority' for this sort of value, rather than
>>'order'.  To me 'order' implies unique value--i.e., with 'order' I am
>>mildly surprised to learn that two entries may have  the same order.  I
>>am not surprised that two entries may share a priority.
> 
> 
> It's wholly unclear to me, given a callback with associated value 0 and
> another with associated value 9999999, which one is supposed to be invoked
> first.  If the parameter is called "priority", then I'd expect 9999999 to
> "win"; if it's called "order", then 0.
> 

right.

To make it clear the idea is if you got this and if we call it "order".

Callback Ca order 0
Callback Cb order 999999
Callback Cc order -999999

The order of execution will be Cc Ca and then Cb.

Note the ones with a default order (e.g : 0) will be executed in the
order of the regitration as it is currently.

You ok with this ?

Note, the wording 'order' comes from Jim's implementation within Zope3
that I wanted to follow for consistency.

http://svn.zope.org/Zope3/trunk/src/zope/configuration/interfaces.py?rev=37552&view=auto

IConfigurationContext.action() for instance. an action with order
9999999 will be invoked after the other ones.

And, of course, if it's called a priority then the execution will be be
the opposite : Cb, Ca, Cc

Now, it's probably better to use "order" to keep consistency with Zope3.

> It's certainly easy to implement.  The Collector will remain open all
> weekend for patches <wink>.
> 

Well, I'd rather do a branch including the modifications and the tests
that we could merge after. For you and for me it will be easier. Except
if the ZODB sub-area of the Zope.org repository is a resticted one ?

	J.


- --
Julien Anguenot | Nuxeo R&D (Paris, France)
CPS Platform : http://www.cps-project.org
Zope3 / ECM   : http://www.z3lab.org
mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFC9PCBGhoG8MxZ/pIRAr2SAJ4hdwSzr2WsMt6rTaaWSJStP/wt3ACeKU14
EG+4IlD7GfczX5jCu2tLx7o=
=c3Ay
-----END PGP SIGNATURE-----


More information about the ZODB-Dev mailing list