Using Windows and Triggers
Operations like Flow.reduce/3, group_by/2, and take_sort/3 require all events to complete before producing a result. After all, you cannot group or sort a list without having all the data in the list available to you. But what if the data source keeps producing events for a really long time, or keeps producing events forever? This means that you will have to wait for a result either a very long time, or indefinitely. To avoid this, Flow introduces windows and triggers. In this section, you will see how they can help you get progress updates with long-running flows.
All events going through Flow are grouped together by a window. You can think of windows as folders for events—they allow you to organize the data in a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access