module Onyx::EDA::Consumer(T)


A module which would make an including object an event consumer. Consumption differs from subscription in a way that only a single consumption instance with certain ID would be notified about an event. In this module, consumer ID equals to the including object class name.

This module behaves a lot like Subscriber, see its docs for details.

Included Modules

Defined in:


Instance Method Summary

Instance methods inherited from module Onyx::EDA::Actor

subscribe(channel : Onyx::EDA::Channel) : self subscribe, unsubscribe(channel : Onyx::EDA::Channel) : self unsubscribe

Instance Method Detail

abstract def handle(event : T) #

Handle incoming event. Must be defined explicitly in a consumer.

TODO Find a way to enable per-event custom ID.

[View source]