← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 2313.e.5.f.11.a.2.b.2

过滤与拆分的区别

理解等级:中级

过滤只保留满足条件的输入,其余退出该流;拆分根据条件将输入导向不同队列,通常不丢弃工作,也可同时送多个分支。通知场景中,过滤选择同意接收的用户,拆分选择短信或邮件通道。复制加过滤可以实现拆分,但直接命名拆分更清楚地表达业务意图。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Chapter 12. Event-Driven Batch Processing · 查看原书依据

      The role of a splitter is to evaluate some criteria—just like a filter—but instead of eliminating input, the splitter sends different inputs to different queues based on that criteria. An example of an application of the splitter pattern is processing online orders where people can receive shipping notifications

    参考来源

    - 位置:《Designing Distributed Systems, 2nd Edition》第12章《Chapter 12. Event-Driven Batch Processing》(来源项目 book-sources;源文件:extracted/Designing Distributed Systems, 2nd Edition/_epub-src/OEBPS/ch12.html) - 结论依据:原文以通知订阅对比filter、splitter与copier组合。 - 原始内容:The role of a splitter is to evaluate some criteria—just like a filter—but instead of eliminating input, the splitter sends different inputs to different queues based on that criteria. An example of an application of the splitter pattern is processing online orders where people can receive shipping notifications