Sha256: f8e9cabce0d6635a7f602ecc0f36263eb85f995fab6c0e03eb6b92479e24411c

Contents?: true

Size: 915 Bytes

Versions: 1

Compression:

Stored size: 915 Bytes

Contents

require "untied-publisher/version"

require 'rubygems'
require 'bundler/setup'
require 'amqp/utilities/event_loop_helper'

module Untied
  module Publisher
    def self.start
      Thread.abort_on_exception = false

      self.run do
        AMQP.start
      end
    end

    def self.run(&block)
      @block = block
      if defined?(PhusionPassenger)
        PhusionPassenger.on_event(:starting_worker_process) do |forked|
          EM.stop if forked && EM.reactor_running?
          Thread.new { EM.run { @block.call } }
        end
      else
        AMQP::Utilities::EventLoopHelper.run { @block.call }
      end
    end
  end
end


require 'untied-publisher/event_representer'
require 'untied-publisher/event'
require 'untied-publisher/config'
require 'untied-publisher/doorkeeper'
require 'untied-publisher/observer'
require 'untied-publisher/producer'
require 'untied-publisher/railtie' if defined?(Rails)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
untied-publisher-0.0.5 lib/untied-publisher.rb