Java moderation workflow
I have a moderation application with more than one moderators. Instead of all moderator getting the same list of messages to moderate and creating possible collisions (moderating the sa开发者_JAVA技巧me message, and waste time), is there a way to send a unique list of messages to each moderator and allow for messages not moderated in a given time to be available to other moderators.
I have a large number of moderators and messages so performance is of importance.
I would have a Queue<Message> messagesToModerate
and a List<Moderator> moderators
. When a message is flagged for moderation, you add it to the Queue. At the same time, you have a ModerationManagerThread that's constantly listening for activity on the Queue and, when it has something, sends it to the next moderator in the list. When it gets to the end, it just starts over. It also has a List<Message> messagesUnderModeration
. Each message gets added to this list when it gets sent to a moderator. Every hour, this list is checked - if the message has been accessed by a moderator (you'll need a flag in the Message object that it has been accessed by a moderator) it gets removed from the list. If not, it gets added to the Message Queue to be sent to another (probably different) moderator.
This should get your messages to your moderators quickly. It also gives you the ability, since you're knowing when it gets accessed and "unflagged" by your moderators, to easily track which moderators are doing their duty, and which ones aren't.
Have you though about using a rules engine like drools ?
精彩评论