lib/onstomp/interfaces/connection_events.rb in onstomp-1.0.0 vs lib/onstomp/interfaces/connection_events.rb in onstomp-1.0.1
- old
+ new
@@ -4,32 +4,36 @@
module OnStomp::Interfaces::ConnectionEvents
include OnStomp::Interfaces::EventManager
# @group Connection State Events
+ # @api gem:1 STOMP:1.0,1.1
# Binds a callback to be invoked when a connection has been fully
# established between broker and client.
# @yield [client, connection] callback invoked when event is triggered
# @yieldparam [OnStomp::Client] client
# @yieldparam [OnStomp::Connections::Base] connection that triggered
# the event (in general the same as +client.connection+)
create_event_methods :established, :on
+ # @api gem:1 STOMP:1.1
# Binds a callback to be invoked when a connection has been died due to
# insufficient data transfer.
# @note Only applies to STOMP 1.1 connections with heartbeating enabled.
# @yield [client, connection] callback invoked when event is triggered
# @yieldparam [OnStomp::Client] client
# @yieldparam [OnStomp::Connections::Base] connection that triggered
# the event (in general the same as +client.connection+)
create_event_methods :died, :on
+ # @api gem:1 STOMP:1.0,1.1
# Binds a callback to be invoked when a connection has been terminated
# (eg: closed unexpectedly due to an exception)
# @yield [client, connection] callback invoked when event is triggered
# @yieldparam [OnStomp::Client] client
# @yieldparam [OnStomp::Connections::Base] connection that triggered
# the event (in general the same as +client.connection+)
create_event_methods :terminated, :on
+ # @api gem:1 STOMP:1.0,1.1
# Binds a callback to be invoked when a connection has been closed, either
# through a graceful disconnect or unexpectedly.
# @note If connection is closed unexpectedly, {#on_died} is triggered first,
# followed by this event.
# @yield [client, connection] callback invoked when event is triggered
@@ -45,10 +49,10 @@
def trigger_connection_event event, msg=''
trigger_event :"on_#{event}", self.client, self, msg
end
# Takes a hash of event bindings a {OnStomp::Client client} has stored
- # and binds them to this connection, then triggers +on_established+.
+ # and binds them to this connection, then triggers `on_established`.
# This allows users to add callbacks for
# connection events before the connection exist and have said callbacks
# installed once the connection is created.
# @param [{Symbol => Array<Proc>}] callbacks to install, keyed by event name
# @see OnStomp::Interfaces::ClientEvents#pending_connection_events