Class: RubyRabbitmqJanus::RRJTask
Overview
# RubyRabbitmqJanus - Task
This class is used with rake task.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from RRJ
Instance Method Summary collapse
-
#handle_endpoint_private(options = {}) ⇒ Object
Create a transaction between Apps and Janus in queue private.
-
#handle_endpoint_public(_options) ⇒ Object
For task is impossible to calling this method.
-
#initialize ⇒ RRJTask
constructor
A new instance of RRJTask.
-
#session_endpoint_private(options = {}) ⇒ Object
Create a transaction between Apps and Janus in queue private.
-
#session_endpoint_public(_options) ⇒ Object
For task is impossible to calling this method.
-
#start_transaction(options = {}) ⇒ Object
deprecated
Deprecated.
Use #session_endpoint_private instead
-
#start_transaction_handle(exclusive = true, options = {}) ⇒ Object
Create a transaction between apps and janus with a handle.
Methods inherited from RRJ
Constructor Details
Instance Method Details
#handle_endpoint_private(options = {}) ⇒ Object
Create a transaction between Apps and Janus in queue private
:reek:FeatureEnvy
113 114 115 116 117 118 119 120 121 |
# File 'lib/rrj/task.rb', line 113 def handle_endpoint_private( = {}) janus = session_instance() handle = 0 # Create always a new handle transaction = Janus::Transactions::Handle.new(true, janus.session, handle, janus.instance) transaction.connect { yield(transaction) } end |
#handle_endpoint_public(_options) ⇒ Object
For task is impossible to calling this method
85 86 87 |
# File 'lib/rrj/task.rb', line 85 def handle_endpoint_public() nil end |
#session_endpoint_private(options = {}) ⇒ Object
Create a transaction between Apps and Janus in queue private
58 59 60 61 62 |
# File 'lib/rrj/task.rb', line 58 def session_endpoint_private( = {}) transaction = Janus::Transactions::Session.new(true, ['session_id']) transaction.connect { yield(transaction) } end |
#session_endpoint_public(_options) ⇒ Object
For task is impossible to calling this method.
65 66 67 |
# File 'lib/rrj/task.rb', line 65 def session_endpoint_public() nil end |
#start_transaction(options = {}) ⇒ Object
Use #session_endpoint_private instead
Start a transaction with Janus. Request use session_id information.
33 34 35 36 37 38 39 |
# File 'lib/rrj/task.rb', line 33 def start_transaction( = {}) transaction = Janus::Transactions::Session.new(true, ['session_id']) transaction.connect { yield(transaction) } rescue raise Errors::RRJ::StartTransaction.new(true, ) end |
#start_transaction_handle(exclusive = true, options = {}) ⇒ Object
Create a transaction between apps and janus with a handle
72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/rrj/task.rb', line 72 def start_transaction_handle(exclusive = true, = {}) janus = session_instance() handle = 0 # Create always a new handle transaction = Janus::Transactions::Handle.new(exclusive, janus.session, handle, janus.instance) transaction.connect { yield(transaction) } rescue raise Errors::RRJTask::StartTransactionHandle.new(exclusive, ) end |