lib/onstomp/interfaces/client_events.rb in onstomp-1.0.0 vs lib/onstomp/interfaces/client_events.rb in onstomp-1.0.1

- old
+ new

@@ -1,104 +1,123 @@ # -*- encoding: utf-8 -*- # Mixin for {OnStomp::Client client} events # There are a few special event methods that will be passed on # to the client's connection, they are: -# * +on_connection_established+ => {OnStomp::Interfaces::ConnectionEvents#on_established} -# * +on_connection_died+ => {OnStomp::Interfaces::ConnectionEvents#on_died} -# * +on_connection_terminated+ => {OnStomp::Interfaces::ConnectionEvents#on_terminated} -# * +on_connection_closed+ => {OnStomp::Interfaces::ConnectionEvents#on_closed} +# * `on_connection_established` => {OnStomp::Interfaces::ConnectionEvents#on_established} +# * `on_connection_died` => {OnStomp::Interfaces::ConnectionEvents#on_died} +# * `on_connection_terminated` => {OnStomp::Interfaces::ConnectionEvents#on_terminated} +# * `on_connection_closed` => {OnStomp::Interfaces::ConnectionEvents#on_closed} module OnStomp::Interfaces::ClientEvents include OnStomp::Interfaces::EventManager # @group Client Frame Event Bindings - # Can't get +before+ because the CONNECT frame isn't transmitted by + # @api gem:1 STOMP:1.0,1.1 + # Can't get `before` because the CONNECT frame isn't transmitted by # the client. + # @yield [frame, client] callback invoked when event is triggered + # @yieldparam [OnStomp::Components::Frame] frame + # @yieldparam [OnStomp::Client] client create_event_methods :connect, :on - + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when an ACK frame is transmitted # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :ack, :before, :on + # @api gem:1 STOMP:1.1 # Binds a callback to be invoked when a NACK frame is transmitted # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :nack, :before, :on + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when a BEGIN frame is transmitted # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :begin, :before, :on + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when an ABORT frame is transmitted # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :abort, :before, :on + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when a COMMIT frame is transmitted # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :commit, :before, :on + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when a SEND frame is transmitted # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :send, :before, :on + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when a SUBSCRIBE frame is transmitted # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :subscribe, :before, :on + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when an UNSUBSCRIBE frame is transmitted # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :unsubscribe, :before, :on + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when a DISCONNECT frame is transmitted # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :disconnect, :before, :on + # @api gem:1 STOMP:1.1 # Binds a callback to be invoked when a client heartbeat is transmitted # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :client_beat, :before, :on # @group Broker Frame Event Bindings - + + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when an ERROR frame is received # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :error, :before, :on + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when a MESSAGE frame is received # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :message, :before, :on + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when a RECEIPT frame is received # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :receipt, :before, :on + # @api gem:1 STOMP:1.1 # Binds a callback to be invoked when a broker heartbeat is received # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :broker_beat, :before, :on # @group Frame Exchange Event Bindings + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when any frame is transmitted # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :transmitting, :before, :after + # @api gem:1 STOMP:1.0,1.1 # Binds a callback to be invoked when any frame is received # @yield [frame, client] callback invoked when event is triggered # @yieldparam [OnStomp::Components::Frame] frame # @yieldparam [OnStomp::Client] client create_event_methods :receiving, :before, :after @@ -137,34 +156,34 @@ :"#{pref}_#{origin}_beat" trigger_event e, f, self end # Triggers the :before_receiving event and the - # +before+ prefixed frame specific event (eg: +:before_error+). + # `before` prefixed frame specific event (eg: +:before_error+). # @param [OnStomp::Components::Frame] f def trigger_before_receiving f trigger_event :before_receiving, f, self trigger_frame_event f, :before, :broker end # Triggers the :after_receiving event and the - # +on+ prefixed frame specific event (eg: +:on_message+) + # `on` prefixed frame specific event (eg: +:on_message+) # @param [OnStomp::Components::Frame] f def trigger_after_receiving f trigger_event :after_receiving, f, self trigger_frame_event f, :on, :broker end # Triggers the :before_transmitting event and the - # +before+ prefixed frame specific event (eg: +:before_disconnect+). + # `before` prefixed frame specific event (eg: +:before_disconnect+). # @param [OnStomp::Components::Frame] f def trigger_before_transmitting f trigger_event :before_transmitting, f, self trigger_frame_event f, :before, :client end # Triggers the :after_transmitting event and the - # +on+ prefixed frame specific event (eg: +:on_send+). + # `on` prefixed frame specific event (eg: +:on_send+). # @param [OnStomp::Components::Frame] f def trigger_after_transmitting f trigger_event :after_transmitting, f, self trigger_frame_event f, :on, :client end