Published on 23 May 2019 by @mathiasverraes
Only keep one event per time unit from a high frequency stream.
A stream of Ephemeral Events is too much to handle for a consumer.
An intermediary consumer is placed in front of the original consumer. It drops all events, except once per time unit, where it passes the event to the original consumer.
This pattern is very common in user interfaces. An input device, such as a mouse, emits it’s position at 500 Hz. Instead of rendering at the same frequency, the stream is throttled at 5Hz, and therefore the consumer only needs to rerender 5 times per second.
Follow @mathiasverraes on Twitter.
This work by Mathias Verraes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 License.