amq-client 0.7.0.alpha22 → 0.7.0.alpha23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,11 +112,11 @@ module AMQ
|
|
112
112
|
self.socket = socket
|
113
113
|
end
|
114
114
|
|
115
|
-
# Registers
|
116
|
-
# @see #
|
115
|
+
# Registers on_open callback
|
116
|
+
# @see #on_open
|
117
117
|
# @api private
|
118
118
|
def register_connection_callback(&block)
|
119
|
-
self.
|
119
|
+
self.on_open(&block)
|
120
120
|
end
|
121
121
|
|
122
122
|
# Performs basic initialization. Do not use this method directly, use
|
@@ -138,16 +138,18 @@ module AMQ
|
|
138
138
|
# Sets a callback for successful connection (after we receive open-ok)
|
139
139
|
#
|
140
140
|
# @api public
|
141
|
-
def
|
141
|
+
def on_open(&block)
|
142
142
|
define_callback :connect, &block
|
143
143
|
end
|
144
|
+
alias on_connection on_open
|
144
145
|
|
145
146
|
# Sets a callback for disconnection (as in client-side disconnection)
|
146
147
|
#
|
147
148
|
# @api public
|
148
|
-
def
|
149
|
+
def on_closed(&block)
|
149
150
|
define_callback :disconnect, &block
|
150
151
|
end
|
152
|
+
alias on_disconnection on_closed
|
151
153
|
|
152
154
|
# Sets a callback for tcp connection failure (as in can't make initial connection)
|
153
155
|
def on_tcp_connection_failure(&block)
|
@@ -65,17 +65,19 @@ module AMQ
|
|
65
65
|
#
|
66
66
|
# @see on_possible_authentication_failure
|
67
67
|
# @api public
|
68
|
-
def
|
68
|
+
def on_open(&block)
|
69
69
|
@connection_deferrable.callback(&block)
|
70
|
-
end #
|
70
|
+
end # on_open(&block)
|
71
|
+
alias on_connection on_open
|
71
72
|
|
72
73
|
# Defines a callback that will be run when broker confirms connection termination
|
73
74
|
# (client receives connection.close-ok). You can define more than one callback.
|
74
75
|
#
|
75
76
|
# @api public
|
76
|
-
def
|
77
|
+
def on_closed(&block)
|
77
78
|
@disconnection_deferrable.callback(&block)
|
78
|
-
end #
|
79
|
+
end # on_closed(&block)
|
80
|
+
alias on_disconnection on_closed
|
79
81
|
|
80
82
|
# Defines a callback that will be run when initial TCP connection fails.
|
81
83
|
# You can define only one callback.
|
@@ -101,14 +103,14 @@ module AMQ
|
|
101
103
|
@on_possible_authentication_failure = block
|
102
104
|
end
|
103
105
|
|
104
|
-
# @see #
|
106
|
+
# @see #on_open
|
105
107
|
# @private
|
106
108
|
def register_connection_callback(&block)
|
107
109
|
unless block.nil?
|
108
110
|
# delay calling block we were given till after we receive
|
109
111
|
# connection.open-ok. Connection will notify us when
|
110
112
|
# that happens.
|
111
|
-
self.
|
113
|
+
self.on_open do
|
112
114
|
block.call(self)
|
113
115
|
end
|
114
116
|
end
|
data/lib/amq/client/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amq-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: -
|
4
|
+
hash: -3702664446
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
9
|
- 0
|
10
10
|
- alpha
|
11
|
-
-
|
12
|
-
version: 0.7.0.
|
11
|
+
- 23
|
12
|
+
version: 0.7.0.alpha23
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Jakub Stastny
|