Skip to content

Decouple outcome from content processing #3

@emilymclean

Description

@emilymclean

Currently, the resulting action from a processor is essentially hardcoded into it. If you, say, wanted the PhashProcessor to create a report, rather than posting a comment, the only way to do so is to copy paste and change the code.

I envision this as introducing another interface, Outcome, that matches/accepts a list of flags and an intentionally unspecified data structure, that then takes some action against the content. Flags would be globbed to prevent multiple similar outcomes being generated.

In general, an outcome may generate a report from a list of flags, or remove a post given a flag. More specific outcomes that are coupled to the data structure and know how to handle it could be introduced for the PhashProcessor, allowing it to post a comment listing duplicate posts.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions