Java 审核工作流程
我有一个审核应用程序,有多个审核者。有没有一种方法可以向每个审核者发送唯一的消息列表,并允许在给定的时间内未审核的消息,而不是所有审核者都获得相同的消息列表来审核并造成可能的冲突(审核相同的消息并浪费时间)时间可供其他版主使用。
我有大量的版主和消息,因此性能非常重要。
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 same 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会有一个
Queue; messagesToModerate
和一个List版主
。当消息被标记为需要审核时,您可以将其添加到队列中。同时,您有一个 ModerationManagerThread 不断侦听队列上的活动,并在有活动时将其发送给列表中的下一个主持人。当它到达终点时,它就重新开始。它还有一个List。 messagesUnderModeration
。每条消息在发送给主持人时都会添加到此列表中。每小时都会检查此列表 - 如果该消息已被主持人访问(您需要在 Message 对象中添加一个标志来表明该消息已被主持人访问),则该消息将从列表中删除。如果没有,它会被添加到消息队列中,然后发送给另一个(可能不同的)主持人。这应该可以将您的消息快速发送给版主。它还使您能够轻松跟踪哪些版主正在履行职责,哪些版主没有履行职责,因为您知道它何时被版主访问并“取消标记”。
I would have a
Queue<Message> messagesToModerate
and aList<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 aList<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.
您是否考虑过使用像 drools 这样的规则引擎?
Have you though about using a rules engine like drools ?