知识卡片

普通读书笔记卡 · 303.a.2.a.1 · 生成模型:GPT-6

观察者依赖状态变化

理解等级:中级

观察者在收到变化信号或发现状态变化后,按自身规则更新。增加显示与告警消费者时,主体可以保持同一套状态发布契约。关心最新温度时读取现值即可,关心每次变化时需要记录事件或检测缺口。参见 [[观察通道保留最新值]]。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Chapter 6. Reactive Programming 观察者与主体 · 查看原书依据

      In building our basic reactive system, we are going to implement the observer pattern. With this pattern, we have subjects and then observers that subscribe to updates of that subject. When the subject releases an update, the observers generally react to this update depending on the specific requirements of the observer. For our basic reactive system, we will build a simple heating system. The system

    参考来源

    - 位置:《Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)》第06章《Chapter 6. Reactive Programming》,观察者与主体(来源项目 book-source,extracted/Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)/_epub-src/OEBPS/ch06.html#id39) - 结论依据:暖气例将温度主体、显示和加热观察者分开。 - 原始内容:In building our basic reactive system, we are going to implement the observer pattern. With this pattern, we have subjects and then observers that subscribe to updates of that subject. When the subject releases an update, the observers generally react to this update depending on the specific requirements of the observer. For our basic reactive system, we will build a simple heating system. The system