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.
100 101 102 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 100 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, heders = {}) ⇒ OnStomp::Components::Frame
Transmits an ACK frame generated by the client’s connection.
157 158 159 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 157 def ack *args transmit connection.ack_frame(*args) end |
#beat ⇒ OnStomp::Components::Frame
Transmits a client heartbeat frame generated by the client’s connection.
187 188 189 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 187 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.
86 87 88 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 86 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.
114 115 116 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 114 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.
125 126 127 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 125 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.
179 180 181 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 179 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
17 18 19 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 17 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.
53 54 55 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 53 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.
72 73 74 |
# File 'lib/onstomp/interfaces/frame_methods.rb', line 72 def unsubscribe frame_or_id, headers={} transmit connection.unsubscribe_frame(frame_or_id, headers) end |