Hash: SHA1

Hi Gary,

Gary Poster wrote:
> On Aug 5, 2005, at 6:20 AM, Julien Anguenot wrote:
>> I would like to order the before commit hooks on a transaction by  being
>> able to specify an order for a subscriber at registration time. For  the
>> moment, they are called in the order they've been registred.
> I like this idea, and was just idly wishing for it this morning.


>> The order argument could be an integer with a default value to 0 added
>> to the registration method.
> 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.

right. The "order" wording is present in Zope3 for the same behavior and
that's actually why I proposed this just to stay consistent with Zope3.
But yeah you're right about the meaning. I like better "priority" in
this case as well.

> If negative values are acceptable then a default value of 0 is OK by me.

yup was thinking about negative values as well.

>> We could just insert the subscriber wihin the queue according to this
>> order parameter if found *or* sorting the queue according to this
>> parameter before flushing the queue and calling the hooks.
> I think it would be ideal if before commit hooks with the same  priority
> continue to be in the order in which they were added.  

+1 with this.

> There  are a
> number of ways to accomplish this and I expect you can choose a  very
> reasonable one :-)

right ;)

- --
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
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -  ZODB-Dev@zope.org

Reply via email to