class Nya::Event

Overview

Base class for events

Direct Known Subclasses

Defined in:

nya/event.cr

Class Method Summary

Instance Method Summary

Macro Summary

Class Method Detail

def self.send(name, event : Event) #

Fire an event. Calls #send_async if called not from engine main fiber


[View source]
def self.send_async(name, e : Event) #

Send an event that will be triggered from update fiber


[View source]
def self.subscribe(*events, handler) #

Subscribe handler to event types (events)


[View source]
def self.subscribe(*events, &handler : Event -> ) #

Subscribe proc to event types


[View source]
def self.unsubscribe(handler : EventHandler) #

Unsubscribe handler


[View source]
def self.unsubscribe(id : Int64) #

Unsubscribe handler by ID


[View source]

Instance Method Detail

def status : Nya::EventStatus #

Status of event


[View source]
def status=(status : Nya::EventStatus) #

Status of event


[View source]

Macro Detail

macro subscribe_typed(*args, as t, &proc) #

Helper macro to automatically cast event passed to handler


[View source]