lib/rrj/janus/transactions/transaction.rb in ruby_rabbitmq_janus-1.1.1 vs lib/rrj/janus/transactions/transaction.rb in ruby_rabbitmq_janus-1.1.2
- old
+ new
@@ -1,14 +1,15 @@
# frozen_string_literal: true
+# :reek:TooManyInstanceVariables and :reek:ControlParameter
+# :reek:ControlParameter and :reek:BooleanParameter
module RubyRabbitmqJanus
module Janus
# Define an module for manipulate a message between apps and janus
module Transactions
# @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
# This class work with janus and send a series of message
- # :reek:TooManyInstanceVariables
class Transaction
# Initialize an transaction
def initialize(session)
@rabbit = Rabbit::Connect.new
@session = session
@@ -28,11 +29,10 @@
private
attr_reader :rabbit, :session, :response, :handle, :publish
# determine queue used
- # :reek:ControlParameter and :reek:BooleanParameter
def choose_queue(exclusive)
chan = @rabbit.channel
@publish = if exclusive
Tools::Log.instance.debug \
'Choose an queue Exclusive : ampq.gen-xxx'
@@ -50,10 +50,9 @@
publish = @publish.send_a_message(yield)
Janus::Responses::Standard.new(read_response(publish, exclusive))
end
# Read a response if is a exclusive message
- # :reek:ControlParameter
def read_response(publish, exclusive)
if exclusive
Tools::Log.instance.info '... and read a janus response'
publish
else