gobo icon indicating copy to clipboard operation
gobo copied to clipboard

modularize filters on server side

Open rahulbot opened this issue 8 years ago • 1 comments

The changes in #43 are a good start to this, but we need to do more.

I'd propose a design that has each filter get it's own module under server.filters - ie. server/filters/gender.py, etc. Then at start-time server.scripts.tasks would walk that server.filters package to discover any analyze_[modulename] methods (ie. analyze_gender in gender.py).

rahulbot avatar Jan 05 '18 17:01 rahulbot

I agree. This was to facilitate the easier addition of new filters with minimal changes. The filter needs to be a generic class from which individual filters are inherited. That way, we have a fixed input/output format for the filters. Currently, the filters are doing everything including reading and writing to the DB, which will need to be moved out as well. I'll work on this after I finish work on improving the performance of content fetching (Issue #31).

rajaramsrinivas avatar Jan 07 '18 14:01 rajaramsrinivas