Sha256: 3395afd7bbf9d94b52f8dc65663e332bff66d7f74d6bbf26448401f7b0b119c2

Contents?: true

Size: 1.2 KB

Versions: 13

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

module RubyRabbitmqJanus
  module Process
    # Modules for create autonomous process
    module Concurrencies
      # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
      #
      # # Class for manage threads
      #
      # @abstract Manage thread in this gem for keepalive message and listen
      #   standard queue.
      class Concurrency
        # Initialize class with elements for thread communication
        def initialize
          ::Log.info info_thread
          @rabbit = RubyRabbitmqJanus::Rabbit::Connect.new
          @lock = Mutex.new
          @condition = ConditionVariable.new
        rescue
          raise Errors::Process::Concurencies::Initializer
        end

        private

        def initialize_thread
          @rabbit.transaction_long { transaction_running }
        rescue Interrupt
          ::Log.info "Stop transaction #{self.class.name}"
          @rabbit.close
        end

        def info_thread
          "Create an thread -- #{self.class.name}"
        end

        attr_reader :lock, :condition, :rabbit
      end
    end
  end
end

require 'rrj/process/keepalive/keepalive_initializer'
require 'rrj/process/event'
require 'rrj/process/event_admin'

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ruby_rabbitmq_janus-2.7.2.pre.312 lib/rrj/process/concurrency.rb
ruby_rabbitmq_janus-2.7.2.pre.310 lib/rrj/process/concurrency.rb
ruby_rabbitmq_janus-2.7.2.pre.309 lib/rrj/process/concurrency.rb
ruby_rabbitmq_janus-2.7.2.pre.308 lib/rrj/process/concurrency.rb
ruby_rabbitmq_janus-2.7.2.pre.307 lib/rrj/process/concurrency.rb
ruby_rabbitmq_janus-2.7.2.pre.306 lib/rrj/process/concurrency.rb
ruby_rabbitmq_janus-2.7.2.pre.305 lib/rrj/process/concurrency.rb
ruby_rabbitmq_janus-2.7.2.pre.302 lib/rrj/process/concurrency.rb
ruby_rabbitmq_janus-2.7.2.pre.297 lib/rrj/process/concurrency.rb
ruby_rabbitmq_janus-2.7.2.pre.296 lib/rrj/process/concurrency.rb
ruby_rabbitmq_janus-2.7.2.pre.286 lib/rrj/process/concurrency.rb
ruby_rabbitmq_janus-2.7.2.pre.285 lib/rrj/process/concurrency.rb
ruby_rabbitmq_janus-2.7.2.pre.284 lib/rrj/process/concurrency.rb