class

EventHandler::Wrapper(T)

Inherits Reference < Object

Generic class wrapping each installed handler.

Not generally used directly; implicitly created and returned by on(), and sent as an argument to emitted AddHandlerEvent/RemoveHandlerEvent events.

Holds each handler's once, async, and at (initial insertion position in the handler list) settings. at is informational — mainly useful to check for 0 or -1, meaning insertion at the beginning or end of the list.

Constructors

new(handler : T, once : Bool = false, async : Bool = ::EventHandler.async?, at : Int32 = ::EventHandler.at_end, hash = nil)
Source
new(once = false, async = ::EventHandler.async?, at = ::EventHandler.at_end, hash = nil, &handler : T)
Source

Instance methods

async?
Source
call(obj, async = nil)

Dispatches obj to the wrapped handler and returns obj.

Handlers are Proc(T, Nil), so their own return conveys nothing; returning the dispatched event instead lets wait(type, handler)/ wait(type) { ... } yield it, matching the handler-less wait overloads. The async branch also returns obj even though the handler runs in its own fiber. _emit ignores this return value, so dispatch is unaffected.

Source
handler
Source
handler_hash
Source
once?
Source