class EventHandler::Wrapper(T)

Overview

Generic class wrapping each installed handler.

It is generally not used directly; but is exposed by the system in response to on() and is sent as an argument to AnyEvent, AddHandlerEvent, and RemoveHandlerEvent.

It provides additional information about the handler, such as values for once, async, and initial position/index in the list of event's handlers.

The information about the index is informational. The best use is to check it for values of 0 or -1, indicating that handler was added at the beginning or end of list respectively.

Defined in:

wrapper.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(handler : T, once : Bool, async : Bool, at : Int32, hash = nil) #

[View source]

Instance Method Detail

def async? : Bool #

[View source]
def at : Int32 #

[View source]
def call(obj, async) #

[View source]
def handler : T #

[View source]
def handler_hash : UInt64 #

[View source]
def once? : Bool #

[View source]