Processors traverse all properties trying to find handlers

Bug #502289 reported by Russell Cloran
6
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

Revision history for this message
Russell Cloran (russell) wrote :

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 ;)

Revision history for this message
Russell Cloran (russell) wrote :

OK... Without a metaclass for Processors "registration" of handlers and run_every's doesn't seem possible. I think that registration is slightly better than iterating every property of a processor at query time, so I'd like to suggest this gets done at 0.2?

Changed in ibid:
importance: Undecided → Wishlist
milestone: none → 0.2
Changed in ibid:
status: New → Fix Released
milestone: 0.2 → 0.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.