Module: Push::Daemon
- Extended by:
- DatabaseReconnectable
- Defined in:
- lib/push/daemon.rb,
lib/push/daemon/app.rb,
lib/push/daemon/feeder.rb,
lib/push/daemon/logger.rb,
lib/push/daemon/feedback.rb,
lib/push/daemon/delivery_queue.rb,
lib/push/daemon/connection_pool.rb,
lib/push/daemon/delivery_handler.rb,
lib/push/daemon/interruptible_sleep.rb,
lib/push/daemon/database_reconnectable.rb,
lib/push/daemon/feedback/feedback_feeder.rb,
lib/push/daemon/feedback/feedback_handler.rb
Defined Under Namespace
Modules: DatabaseReconnectable, Feedback, InterruptibleSleep Classes: App, ConnectionPool, DeliveryHandler, DeliveryQueue, Feeder, Logger
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
-
.logger ⇒ Object
Returns the value of attribute logger.
Class Method Summary collapse
Methods included from DatabaseReconnectable
adaptor_errors, check_database_is_connected, database_connection_lost, reconnect_database, sleep_to_avoid_thrashing, with_database_reconnect_and_retry
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
20 21 22 |
# File 'lib/push/daemon.rb', line 20 def config @config end |
.logger ⇒ Object
Returns the value of attribute logger.
20 21 22 |
# File 'lib/push/daemon.rb', line 20 def logger @logger end |
Class Method Details
.start(config) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/push/daemon.rb', line 23 def self.start(config) self.config = config self.logger = Logger.new(:foreground => config.foreground, :error_notification => config.error_notification) setup_signal_hooks unless config.foreground daemonize reconnect_database end write_pid_file App.load App.start Feedback.load(config) Feedback.start rescale_poolsize(App.database_connections + Feedback.database_connections) logger.info('[Daemon] Ready') Feeder.start(config) end |