Module: OnStomp::Interfaces::FrameMethods
- Included in:
- Client, Components::Scopes::HeaderScope, Components::Scopes::ReceiptScope, Components::Scopes::TransactionScope, Failover::Client
- Defined in:
- lib/onstomp/interfaces/frame_methods.rb
Overview
Instance Method Summary collapse
-
#abort(tx_id, headers = {}) ⇒ OnStomp::Components::Frame
Transmits an ABORT frame generated by the client's connection to rollback a transaction.
-
#ack(*args) ⇒ OnStomp::Components::Frame
Transmits an ACK frame generated by the client's connection.
-
#beat ⇒ OnStomp::Components::Frame
Transmits a client heartbeat frame generated by the client's connection.
-
#begin(tx_id, headers = {}) ⇒ OnStomp::Components::Frame
Transmits a BEGIN frame generated by the client's connection to start a transaction.
-
#commit(tx_id, headers = {}) ⇒ OnStomp::Components::Frame
Transmits a COMMIT frame generated by the client's connection to complete a transaction.
-
#disconnect(headers = {}) ⇒ OnStomp::Components::Frame
Transmits a DISCONNECT frame generated by the client's connection to end the STOMP session.
-
#nack(*args) ⇒ OnStomp::Components::Frame
Transmits a NACK frame generated by the client's connection.
-
#send(dest, body, headers = {}) {|receipt| ... } ⇒ OnStomp::Components::Frame
(also: #puts)
Transmits a SEND frame generated by the client's connection.
-
#subscribe(dest, headers = {}) {|message| ... } ⇒ OnStomp::Components::Frame
Transmits a SUBSCRIBE frame generated by the client's connection.
-
#unsubscribe(frame_or_id, headers = {}) ⇒ OnStomp::Components::Frame
Transmits an UNSUBSCRIBE frame generated by the client's connection.
Instance Method Details
#abort(tx_id, headers = {}) ⇒ OnStomp::Components::Frame
Transmits an ABORT frame generated by the client's connection to rollback a transaction.
194 195 196 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 194 def abort tx_id, headers={} transmit connection.abort_frame(tx_id, headers) end |
#ack(message_frame, headers = {}) ⇒ OnStomp::Components::Frame #ack(message_id, headers = {}) ⇒ OnStomp::Components::Frame #ack(message_id, subscription_id, headers = {}) ⇒ OnStomp::Components::Frame
Transmits an ACK frame generated by the client's connection.
300 301 302 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 300 def ack *args transmit connection.ack_frame(*args) end |
#beat ⇒ OnStomp::Components::Frame
Transmits a client heartbeat frame generated by the client's connection.
357 358 359 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 357 def beat transmit connection.heartbeat_frame end |
#begin(tx_id, headers = {}) ⇒ OnStomp::Components::Frame
Transmits a BEGIN frame generated by the client's connection to start a transaction.
172 173 174 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 172 def begin tx_id, headers={} transmit connection.begin_frame(tx_id, headers) end |
#commit(tx_id, headers = {}) ⇒ OnStomp::Components::Frame
Transmits a COMMIT frame generated by the client's connection to complete a transaction.
216 217 218 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 216 def commit tx_id, headers={} transmit connection.commit_frame(tx_id, headers) end |
#disconnect(headers = {}) ⇒ OnStomp::Components::Frame
Transmits a DISCONNECT frame generated by the client's connection to end the STOMP session.
235 236 237 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 235 def disconnect headers={} transmit connection.disconnect_frame headers end |
#nack(message_frame, headers = {}) ⇒ OnStomp::Components::Frame #nack(message_id, subscription_id, heders = {}) ⇒ OnStomp::Components::Frame
Transmits a NACK frame generated by the client's connection.
343 344 345 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 343 def nack *args transmit connection.nack_frame(*args) end |
#send(dest, body, headers = {}) {|receipt| ... } ⇒ OnStomp::Components::Frame Also known as: puts
Transmits a SEND frame generated by the client's connection
59 60 61 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 59 def send dest, body, headers={}, &cb transmit connection.send_frame(dest, body, headers), :receipt => cb end |
#subscribe(dest, headers = {}) {|message| ... } ⇒ OnStomp::Components::Frame
Transmits a SUBSCRIBE frame generated by the client's connection. Depending
upon the connection, a subscription can be set to various MESSAGE
acknowledgement modes by setting the :ack
header.
STOMP 1.0 and STOMP 1.1 connections support:
- :ack => 'auto' The broker assumes that MESSAGE frames received through the subscription have been properly received, the client should NOT attempt to ACK (or NACK) any of the messages.
- :ack => 'client' The broker assumes that MESSAGE frames should be acknowledged by the client through the use of ACK frames. STOMP 1.1 connections support:
- :ack => 'client-individual' Upon receiving an ACK frame for a MESSAGE frame, some brokers will mark the MESSAGE frame and all those sent to the client before it as acknowledged. This mode indicates that each MESSAGE frame must be acknowledged by its own ACK frame for the broker can assume the MESSAGE frame has been received by the client.
121 122 123 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 121 def subscribe dest, headers={}, &cb transmit connection.subscribe_frame(dest, headers), :subscribe => cb end |
#unsubscribe(subscribe_frame, headers = {}) ⇒ OnStomp::Components::Frame #unsubscribe(id, headers = {}) ⇒ OnStomp::Components::Frame
Transmits an UNSUBSCRIBE frame generated by the client's connection.
150 151 152 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 150 def unsubscribe frame_or_id, headers={} transmit connection.unsubscribe_frame(frame_or_id, headers) end |