Hi
On 10.04.2013 14:36, Andrej Golcov wrote:
Is the Trac community interested in applying something like
IResourceChangeListener into the Trac codebase?
Looks interesting.
Just in case you are not aware of it: There's an old open ticket #8834
"Add a generic IResourceChangeListener".
http://trac.edgewall.org/ticket/8834
While I think your patch deserves a new ticket, reviewing the comments
there might be interesting.
Summary of comments 1-8:
* Resources vs. Model instances: Passing model instances as parameters
to the listeners was preferred. (As in your patch.) Comment 2 suggests
not calling them resources to avoid confusion.
* old_values vs. alternatives: Passing old_values was preferred. (As in
your patch.)
* Comment 1 proposes interfaces based on experience from AnnouncerPlugin
(which has a similar generalization built on top of the existing
listener interfaces).
One detail I find interesting there is that the event types are generic
as well. You seem to be using similar event type identifiers, but only
internally when you call _notify('resource_created', ...) etc. Have you
considered also exposing these in the interface and allowing e.g.
plugins to define new event types? Bad idea? You seem to prefer handling
things like wiki_page_renamed or attachment_reparented using the
catch-all resource_changed event.
(Comments 9-30 are mainly about email notification and how perceived
performance might be improved with threads or multiprocessing.)
Thanks for sharing.
Peter
--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.