-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 28.04.2014 15:30, Christopher Nelson wrote:
> I know I can't guarantee the order of ticket change listeners but if I
> have one that depends on another, is there some way that I can requeue
> the current listener if it detects the other hasn't run yet?
>
> In Tcl you can add something to the event queue with `after idle`.
> Off the top of my head (I haven't written Tcl in years), it'd be like:
>
> func myEventHandler(a, b, c) {
> # If our predecessor hasn't executed yet
> if [ ! someCondition ] {
> # Reschedule this invocation to be run when the interpreter
> # is idle (all other events have been processed)
> after idle $*
> }
> else {
> ... real event handling here
> }
> }
>
> That'd be a great solution here but I don't know how to do that in Trac.
Trac has trac.config.OrderedExtensionsOption [1] for this.
I guess, that unordered ExtensionsOption has been chosen for change
listeners on purpose. IMO these components shall not implement
side-effects on changed resources, as your description suggests for you
component. Please consider implementing ITicketManipulator [2] to ensure
changes in concert with other ticket changes.
Steffen Hoffmann
[1]
http://trac.edgewall.org/wiki/TracDev/ComponentArchitecture#Declaringanextensionpoint
[2]
http://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints/trac.ticket.api.ITicketManipulator
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/
iEYEARECAAYFAlNeX/gACgkQ31DJeiZFuHejMwCdECjScyYu4cuVRmfpweleZPCl
ca0AnRYavkXFFfxyVwEegUJpbCN8jd1h
=FQAe
-----END PGP SIGNATURE-----
--
You received this message because you are subscribed to the Google Groups "Trac
Development" 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/trac-dev.
For more options, visit https://groups.google.com/d/optout.