Processors traverse all properties trying to find handlers
Bug #502289 reported by
Russell Cloran
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ibid |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
When trying to find handlers, a processor traverses all of its properties, tests whether or not they're a method, and then uses them.
The problem with this is that some processors may want to keep some cached data which should only be accessed on first load. If they're all accessed the first time anyone queries the bot, that first query will take a while.
I think Processor should either allow easy overloading of how handlers are found, or @handler/@match() should register handlers so that discovery happens in some way that doesn't involve property traversal.
Related branches
lp:~stefanor/ibid/processor-register-502289
- Michael Gorven: Approve
- Jonathan Hitchcock: Approve
-
Diff: 272 lines (+87/-58)4 files modifiedibid/plugins/__init__.py (+80/-49)
ibid/plugins/bzr.py (+3/-4)
ibid/plugins/feeds.py (+2/-3)
ibid/plugins/icecast.py (+2/-2)
Changed in ibid: | |
status: | New → Fix Released |
milestone: | 0.2 → 0.1 |
To post a comment you must log in.
Hrm ... there are other places which traverse all properties of a Processor (run_every handling)... I'm beginning to think the right fix is, instead, to put my cached data outside of the Processor ;)