Class | Qpid::Proton::Event::Event |
In: |
lib/event/event.rb
|
Parent: | EventBase |
An Event provides notification of a state change within the protocol engine.
Every event has a type that identifies what sort of state change has occurred, along with a pointer to the object whose state has changed, and also any associated objects.
For more details on working with Event, please refer to Collector.
@see Qpid::Proton::Event The list of predefined events.
Notifies the handler(s) of this event.
If a handler responds to the event‘s method then that method is invoked and passed the event. Otherwise, if the handler defines the on_unhandled method, then that will be invoked instead.
If the handler defines a handlers method then that will be invoked and passed the event afterward.
@example
class FallbackEventHandler # since it now defines a handlers method, any event will iterate # through them and invoke the +dispatch+ method on each attr_accessor handlers def initialize @handlers = [] end # invoked for any event not otherwise handled def on_unhandled(event) puts "Unable to invoke #{event.type.method} on #{event.context}." end end
@param handler [Object] An object which implements either the event‘s
handler method or else responds to :handlers with an array of other handlers.