class Rosegold::EventEmitter

Direct Known Subclasses

Defined in:

rosegold/models/event_emitter.cr

Instance Method Summary

Instance Method Detail

def emit_event(event : Event) #

[View source]
def event_handlers : Handlers #

[View source]
def off(event_type : T.class, id : UUID) forall T #

[View source]
def on(event_type : T.class, id : UUID = UUID.random, &block : T -> ) forall T #

[View source]
def once(event_type : T.class, &block : T -> ) forall T #

[View source]
def wait_for(event_type : T.class, timeout : Time::Span | Nil = nil) forall T #

Waits for an event, if timeout is given, it will return nil if the timeout is reached before the event is emitted.


[View source]