class

Rosegold::EventEmitter

Inherits Reference / Object

Instance methods

emit_event(event : Event)
Source
event_handlers
Source
off(event_type : T.class, id : UUID) forall T
Source
on(event_type : T.class, id : UUID = UUID.random, &block : T -> ) forall T
Source
once(event_type : T.class, &block : T -> ) forall T
Source
wait_for(event_type : T.class, timeout : Time::Span = 5.seconds) forall T

Waits for an event. Returns nil on timeout.

Source
wait_for(event_type : T.class, timeout : Time::Span = 5.seconds, &) forall T

Registers listener before running block, then waits. Raises on timeout.

Source

Nested types