← 返回刚才阅读的位置

知识卡片

问题卡 · 4545.g.8.j.2

去抖合并成簇重复调用

理解等级:中级

Debounce按连续活动簇保留一次调用:首沿形式立即执行一次,并对紧随的调用复用结果;末沿形式等到活动停顿才执行,适合等待用户输入完成。它不同于按固定速率放行的限流。若调用方需要每次独立结果,缓存上次结果或延后执行可能改变业务语义。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Cloud Native Patterns · 查看原书依据

      Debounce focuses on clusters of activity, making sure that a function is called only once during a cluster of requests, either at the start or the end of the cluster. A function-first debounce implementation is illustrated above: for each of the two clusters of calls to the input function, Debounce only allows one call to

    参考来源

    - 位置:《Cloud Native Go》第04章《Cloud Native Patterns》(来源项目book-sources;源文件:extracted/Cloud Native Go (Matthew A. Titmus)/_epub-src/OEBPS/ch04.xhtml) - 结论依据:Debounce按连续活动簇保留一次调用:首沿形式立即执行一次,并对紧随的调用复用结果;末沿形式等到活动停顿才执行,适合等待用户输入完成。原文相应定义、示例或限制为此结论提供依据;补充纠错与版本边界在正文就近标明。 - 原始内容:Debounce focuses on clusters of activity, making sure that a function is called only once during a cluster of requests, either at the start or the end of the cluster. A function-first debounce implementation is illustrated above: for each of the two clusters of calls to the input function, Debounce only allows one call to