Sha256: 380e5b2ec85b10ff8ccf8e94fd511be446cf8e5170216ea32396c6db6b5d7ab5

Contents?: true

Size: 1.41 KB

Versions: 3

Compression:

Stored size: 1.41 KB

Contents

# gem dependencies
require "active_support/core_ext/hash/indifferent_access"
require "active_support/core_ext/hash/except"
require "active_support/dependencies/autoload"
require "active_support/notifications"
require "bunny"

# standard library
require "json"
require "optparse"

# project
require "carrot_rpc/version"

# An opinionated approach to doing Remote Procedure Call (RPC) with RabbitMQ and the bunny gem. CarrotRpc serves as a
# way to streamline the RPC workflow so developers can focus on the implementation and not the plumbing when working
# with RabbitMQ.
module CarrotRpc
  extend ActiveSupport::Autoload

  autoload :CLI
  autoload :ClientActions
  autoload :ClientServer
  autoload :Configuration
  autoload :Error
  autoload :Exception
  autoload :Format
  autoload :HashExtensions
  autoload :Reply
  autoload :RpcClient
  autoload :RpcServer
  autoload :ServerRunner
  autoload :Scrub
  autoload :TaggedLog

  class << self
    attr_writer :configuration
  end

  def self.configuration
    @configuration ||= Configuration.new
  end

  # Resets the configuration back to a new instance. Should only be used in testing.
  def self.reset
    @configuration = Configuration.new
  end

  def self.configure
    yield configuration
  end

  # Attempts to start a connection to the existing Bunny object.
  # @return [Bunny::Session]
  def self.connect
    bunny = configuration.bunny
    bunny.start unless bunny.open?
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
carrot_rpc-1.2.1 lib/carrot_rpc.rb
carrot_rpc-1.2.0 lib/carrot_rpc.rb
carrot_rpc-1.1.0 lib/carrot_rpc.rb