Expand description
An event source that aggregates sent events together for each receiver.
This can be used to create a sort of event-based diff update mechanism, where a normal stream-of-event sources are not suitable.
A good example is the object store. If store updates are a stream of events, we can imagine a sequence of events like:
- Insert Object { id: 1, interface: wl_surface }
- Remove Object { id: 1 }
- Insert Object { id: 1, interface: wl_buffer }
If listener only started reading the events after the third event, they will start processing the first insertion event and find out object 1 is not actually a wl_surface, and be confused.
What should really happen is that the first two events should “cancel out” for that listener, and the listener should only see the third one.
The aggregate event source will do exactly that.
Structs
- A receiver for the aggregate event source.
- A sender for the aggregate event source.