Expand description
Traits and types related to event
The EventSource
trait is the core of how events are delivered. And it’s
quite simple. Types that can emit events, will implement this trait. And a
stream of events can be obtained from that type by calling
EventSource::subscribe
. This stream of events can then be registered
with Client::EventDispatcher
together with an event handler. And the event dispatcher will call the
handler whenever a new event is received from the stream. Note as it is the
compositor author who will implement the Client
trait, so they are the
ones who are responsible for calling event handlers.
This crate and other runa
related crates will provide some event sources.
For example, Store
is an event source that
emits events whenever there is an object being inserted or removed from the
store. But runa
crates will also expect downstream compositor authors to
implement their own event sources. You will see EventSource
trait bounds
when that is the case.
Modules
- An event source that aggregates sent events together for each receiver.
- A simple broadcast event source based on [
async_broadcast
] - A event source that a single event, and overwrites it when a new event is sent.
Traits
- Event source