Module: Asynk

Defined in:
lib/asynk/broker.rb,
lib/asynk.rb,
lib/asynk/cli.rb,
lib/asynk/config.rb,
lib/asynk/server.rb,
lib/asynk/worker.rb,
lib/asynk/logging.rb,
lib/asynk/message.rb,
lib/asynk/version.rb,
lib/asynk/consumer.rb,
lib/asynk/response.rb,
lib/asynk/benchmark.rb,
lib/asynk/publisher.rb,
lib/asynk/test_helper.rb,
lib/asynk/sync_publisher.rb

Overview

require ‘carrot-top’

Defined Under Namespace

Modules: Consumer, TestHelper Classes: Benchmark, Broker, CLI, Config, Logging, Message, Publisher, Response, Server, SyncPublisher, Worker

Constant Summary collapse

DEFAULTS =
{
  require: '.',
  environment: nil
}
VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.booted_inside=(value) ⇒ Object



59
60
61
# File 'lib/asynk.rb', line 59

def booted_inside=(value)
  @booted_inside = value
end

.booted_inside?Boolean

Returns:

  • (Boolean)


57
# File 'lib/asynk.rb', line 57

def booted_inside?; @booted_inside; end

.brokerObject



55
# File 'lib/asynk.rb', line 55

def broker; Broker; end

.configObject



63
# File 'lib/asynk.rb', line 63

def config; Config.instance; end

.consumersObject



31
32
33
# File 'lib/asynk.rb', line 31

def consumers
  @consumers ||= []
end

.loggerObject



43
44
45
# File 'lib/asynk.rb', line 43

def logger
  Asynk::Logging.logger
end

.logger=(log) ⇒ Object



47
48
49
# File 'lib/asynk.rb', line 47

def logger=(log)
  Asynk::Logging.logger = log
end

.optionsObject



35
36
37
# File 'lib/asynk.rb', line 35

def options
  @options ||= DEFAULTS.dup
end

.options=(opts) ⇒ Object



39
40
41
# File 'lib/asynk.rb', line 39

def options=(opts)
  @options = opts
end

.register_consumer(consumer) ⇒ Object



26
27
28
29
# File 'lib/asynk.rb', line 26

def register_consumer(consumer)
  return if Asynk.config[:ignored_consumers].include? consumer.name
  self.consumers << consumer
end

.serverObject



51
52
53
# File 'lib/asynk.rb', line 51

def server
  Server.instance
end