Skip to content

Commit efa7d8c

Browse files
Use YARD @group/@endgroup pseudo-tags to group methods on AMQ::Client::Channel together in the documentation
1 parent 42ad7da commit efa7d8c

File tree

1 file changed

+45
-18
lines changed

1 file changed

+45
-18
lines changed

lib/amq/client/channel.rb

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ def connection
8787
@connection
8888
end # connection
8989

90+
91+
# @group Channel lifecycle
92+
9093
# Opens AMQP channel.
9194
#
9295
# @api public
@@ -107,6 +110,11 @@ def close(reply_code = 200, reply_text = DEFAULT_REPLY_TEXT, class_id = 0, metho
107110
self.redefine_callback :close, &block
108111
end
109112

113+
# @endgroup
114+
115+
116+
117+
# @group Message acknowledgements
110118

111119
# Acknowledge one or all messages on the channel.
112120
#
@@ -128,18 +136,6 @@ def reject(delivery_tag, requeue = true)
128136
self
129137
end # reject(delivery_tag, requeue = true)
130138

131-
# Requests a specific quality of service. The QoS can be specified for the current channel
132-
# or for all channels on the connection.
133-
#
134-
# @note RabbitMQ as of 2.3.1 does not support prefetch_size.
135-
# @api public
136-
def qos(prefetch_size = 0, prefetch_count = 32, global = false, &block)
137-
@connection.send_frame(Protocol::Basic::Qos.encode(@id, prefetch_size, prefetch_count, global))
138-
139-
self.redefine_callback :qos, &block
140-
self
141-
end # qos(prefetch_size = 4096, prefetch_count = 32, global = false, &block)
142-
143139
# Notifies AMQ broker that consumer has recovered and unacknowledged messages need
144140
# to be redelivered.
145141
#
@@ -155,6 +151,24 @@ def recover(requeue = true, &block)
155151
self
156152
end # recover(requeue = false, &block)
157153

154+
# @endgroup
155+
156+
157+
158+
# @group QoS and flow handling
159+
160+
# Requests a specific quality of service. The QoS can be specified for the current channel
161+
# or for all channels on the connection.
162+
#
163+
# @note RabbitMQ as of 2.3.1 does not support prefetch_size.
164+
# @api public
165+
def qos(prefetch_size = 0, prefetch_count = 32, global = false, &block)
166+
@connection.send_frame(Protocol::Basic::Qos.encode(@id, prefetch_size, prefetch_count, global))
167+
168+
self.redefine_callback :qos, &block
169+
self
170+
end # qos(prefetch_size = 4096, prefetch_count = 32, global = false, &block)
171+
158172
# Asks the peer to pause or restart the flow of content data sent to a consumer.
159173
# This is a simple flow­control mechanism that a peer can use to avoid overflowing its
160174
# queues or otherwise finding itself receiving more messages than it can process. Note that
@@ -172,6 +186,18 @@ def flow(active = false, &block)
172186
self
173187
end # flow(active = false, &block)
174188

189+
# @return [Boolean] True if flow in this channel is active (messages will be delivered to consumers that use this channel).
190+
#
191+
# @api public
192+
def flow_is_active?
193+
@flow_is_active
194+
end # flow_is_active?
195+
196+
# @endgroup
197+
198+
199+
200+
# @group Transactions
175201

176202
# Sets the channel to use standard transactions. One must use this method at least
177203
# once on a channel before using #tx_tommit or tx_rollback methods.
@@ -204,12 +230,11 @@ def tx_rollback(&block)
204230
self
205231
end # tx_rollback(&block)
206232

207-
# @return [Boolean] True if flow in this channel is active (messages will be delivered to consumers that use this channel).
208-
#
209-
# @api public
210-
def flow_is_active?
211-
@flow_is_active
212-
end # flow_is_active?
233+
# @endgroup
234+
235+
236+
237+
# @group Error handling
213238

214239
# Defines a callback that will be executed when channel is closed after
215240
# channel-level exception.
@@ -219,6 +244,8 @@ def on_error(&block)
219244
self.define_callback(:error, &block)
220245
end
221246

247+
# @endgroup
248+
222249

223250
#
224251
# Implementation

0 commit comments

Comments
 (0)