Module: Nsqcd
- Extended by:
- Nsqcd
- Included in:
- Nsqcd
- Defined in:
- lib/nsqcd.rb,
lib/nsqcd.rb,
lib/nsqcd/errors.rb,
lib/nsqcd/runner.rb,
lib/nsqcd/worker.rb,
lib/nsqcd/version.rb,
lib/nsqcd/workergroup.rb,
lib/nsqcd/configuration.rb,
lib/nsqcd/error_reporter.rb,
lib/nsqcd/concerns/logging.rb,
lib/nsqcd/concerns/metrics.rb,
lib/nsqcd/support/production_formatter.rb
Defined Under Namespace
Modules: Concerns, ErrorReporter, Handlers, Support, Worker, WorkerGroup
Classes: Configuration, Queue, Runner, RunnerConfig, Utils
Constant Summary
collapse
- CONFIG =
Configuration.new
- VERSION =
"0.1.0"
Instance Method Summary
collapse
Instance Method Details
#clear! ⇒ Object
31
32
33
34
35
|
# File 'lib/nsqcd.rb', line 31
def clear!
CONFIG.clear
@logger = nil
@configured = false
end
|
23
24
25
26
27
28
29
|
# File 'lib/nsqcd.rb', line 23
def configure(opts={})
CONFIG.merge!(opts)
setup_general_logger!
setup_worker_concerns!
@configured = true
end
|
64
65
66
|
# File 'lib/nsqcd.rb', line 64
def configure_server
yield self if server?
end
|
52
53
54
|
# File 'lib/nsqcd.rb', line 52
def configured?
@configured
end
|
#daemonize!(loglevel = Logger::INFO) ⇒ Object
37
38
39
40
41
42
|
# File 'lib/nsqcd.rb', line 37
def daemonize!(loglevel=Logger::INFO)
CONFIG[:log] = 'nsqcd.log'
CONFIG[:daemonize] = true
setup_general_logger!
logger.level = loglevel
end
|
#error_reporters ⇒ Object
74
75
76
|
# File 'lib/nsqcd.rb', line 74
def error_reporters
CONFIG[:error_reporters]
end
|
#logger ⇒ Object
48
49
50
|
# File 'lib/nsqcd.rb', line 48
def logger
@logger
end
|
#logger=(logger) ⇒ Object
44
45
46
|
# File 'lib/nsqcd.rb', line 44
def logger=(logger)
@logger = logger
end
|
#server=(server) ⇒ Object
56
57
58
|
# File 'lib/nsqcd.rb', line 56
def server=(server)
@server = server
end
|
#server? ⇒ Boolean
60
61
62
|
# File 'lib/nsqcd.rb', line 60
def server?
@server
end
|