Module: Sneakers
- Extended by:
- Sneakers
- Included in:
- Sneakers
- Defined in:
- lib/sneakers/cli.rb,
lib/sneakers.rb,
lib/sneakers.rb,
lib/sneakers/errors.rb,
lib/sneakers/runner.rb,
lib/sneakers/worker.rb,
lib/sneakers/spawner.rb,
lib/sneakers/version.rb,
lib/sneakers/publisher.rb,
lib/sneakers/workergroup.rb,
lib/sneakers/content_type.rb,
lib/sneakers/configuration.rb,
lib/sneakers/error_reporter.rb,
lib/sneakers/concerns/logging.rb,
lib/sneakers/concerns/metrics.rb,
lib/sneakers/content_encoding.rb,
lib/sneakers/handlers/oneshot.rb,
lib/sneakers/handlers/maxretry.rb,
lib/sneakers/middleware/config.rb,
lib/sneakers/metrics/null_metrics.rb,
lib/sneakers/metrics/statsd_metrics.rb,
lib/sneakers/metrics/logging_metrics.rb,
lib/sneakers/metrics/newrelic_metrics.rb,
lib/sneakers/support/production_formatter.rb
Overview
Defined Under Namespace
Modules: Concerns, ErrorReporter, Handlers, Metrics, Middleware, Support, Worker, WorkerGroup
Classes: CLI, Configuration, ContentEncoding, ContentType, Publisher, Queue, Runner, RunnerConfig, Spawner, Utils
Constant Summary
collapse
- CONFIG =
Configuration.new
- VERSION =
"3.1.1"
Instance Method Summary
collapse
Instance Method Details
#clear! ⇒ Object
42
43
44
45
46
47
|
# File 'lib/sneakers.rb', line 42
def clear!
CONFIG.clear
@logger = nil
@publisher = nil
@configured = false
end
|
33
34
35
36
37
38
39
40
|
# File 'lib/sneakers.rb', line 33
def configure(opts={})
CONFIG.merge!(opts)
setup_general_logger!
setup_worker_concerns!
setup_general_publisher!
@configured = true
end
|
88
89
90
|
# File 'lib/sneakers.rb', line 88
def configure_server
yield self if server?
end
|
76
77
78
|
# File 'lib/sneakers.rb', line 76
def configured?
@configured
end
|
#daemonize!(loglevel = Logger::INFO) ⇒ Object
49
50
51
52
53
54
|
# File 'lib/sneakers.rb', line 49
def daemonize!(loglevel=Logger::INFO)
CONFIG[:log] = 'sneakers.log'
CONFIG[:daemonize] = true
setup_general_logger!
logger.level = loglevel
end
|
#error_reporters ⇒ Object
98
99
100
|
# File 'lib/sneakers.rb', line 98
def error_reporters
CONFIG[:error_reporters]
end
|
#logger ⇒ Object
68
69
70
|
# File 'lib/sneakers.rb', line 68
def logger
@logger
end
|
#logger=(logger) ⇒ Object
64
65
66
|
# File 'lib/sneakers.rb', line 64
def logger=(logger)
@logger = logger
end
|
#publish(msg, routing) ⇒ Object
72
73
74
|
# File 'lib/sneakers.rb', line 72
def publish(msg, routing)
@publisher.publish(msg, routing)
end
|
#rake_worker_classes ⇒ Object
60
61
62
|
# File 'lib/sneakers.rb', line 60
def rake_worker_classes
@rake_worker_classes
end
|
#rake_worker_classes=(worker_classes) ⇒ Object
56
57
58
|
# File 'lib/sneakers.rb', line 56
def rake_worker_classes=(worker_classes)
@rake_worker_classes = worker_classes
end
|
#server=(server) ⇒ Object
80
81
82
|
# File 'lib/sneakers.rb', line 80
def server=(server)
@server = server
end
|
#server? ⇒ Boolean
84
85
86
|
# File 'lib/sneakers.rb', line 84
def server?
@server
end
|