Module: Rpush::Daemon
- Defined in:
- lib/rpush/daemon.rb,
lib/rpush/daemon/adm.rb,
lib/rpush/daemon/fcm.rb,
lib/rpush/daemon/rpc.rb,
lib/rpush/daemon/wns.rb,
lib/rpush/daemon/wpns.rb,
lib/rpush/daemon/apns2.rb,
lib/rpush/daemon/batch.rb,
lib/rpush/daemon/pushy.rb,
lib/rpush/daemon/apnsp8.rb,
lib/rpush/daemon/feeder.rb,
lib/rpush/daemon/webpush.rb,
lib/rpush/daemon/delivery.rb,
lib/rpush/daemon/loggable.rb,
lib/rpush/daemon/constants.rb,
lib/rpush/daemon/app_runner.rb,
lib/rpush/daemon/proc_title.rb,
lib/rpush/daemon/rpc/client.rb,
lib/rpush/daemon/rpc/server.rb,
lib/rpush/daemon/ring_buffer.rb,
lib/rpush/daemon/store/redis.rb,
lib/rpush/daemon/adm/delivery.rb,
lib/rpush/daemon/apnsp8/token.rb,
lib/rpush/daemon/fcm/delivery.rb,
lib/rpush/daemon/synchronizer.rb,
lib/rpush/daemon/wns/delivery.rb,
lib/rpush/daemon/queue_payload.rb,
lib/rpush/daemon/wpns/delivery.rb,
lib/rpush/daemon/apns2/delivery.rb,
lib/rpush/daemon/pushy/delivery.rb,
lib/rpush/daemon/signal_handler.rb,
lib/rpush/daemon/string_helpers.rb,
lib/rpush/daemon/apnsp8/delivery.rb,
lib/rpush/daemon/dispatcher/http.rb,
lib/rpush/daemon/dispatcher_loop.rb,
lib/rpush/daemon/store/interface.rb,
lib/rpush/daemon/wns/raw_request.rb,
lib/rpush/daemon/webpush/delivery.rb,
lib/rpush/daemon/wns/post_request.rb,
lib/rpush/daemon/wns/badge_request.rb,
lib/rpush/daemon/wns/toast_request.rb,
lib/rpush/daemon/interruptible_sleep.rb,
lib/rpush/daemon/retry_header_parser.rb,
lib/rpush/daemon/store/active_record.rb,
lib/rpush/daemon/dispatcher/apns_http2.rb,
lib/rpush/daemon/service_config_methods.rb,
lib/rpush/daemon/dispatcher/apnsp8_http2.rb,
lib/rpush/daemon/google_credential_cache.rb,
lib/rpush/daemon/store/active_record/reconnectable.rb
Defined Under Namespace
Modules: Adm, Apns2, Apnsp8, Dispatcher, Fcm, Loggable, Pushy, Rpc, ServiceConfigMethods, Store, StringHelpers, Webpush, Wns, Wpns Classes: AppRunner, Batch, Delivery, DispatcherLoop, Feeder, GoogleCredentialCache, InterruptibleSleep, ProcTitle, QueuePayload, RetryHeaderParser, RingBuffer, SignalHandler, Synchronizer
Constant Summary collapse
- HTTP_STATUS_CODES =
{ 100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 226 => 'IM Used', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Reserved', 307 => 'Temporary Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 418 => "I'm a Teapot", 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 426 => 'Upgrade Required', 429 => 'Too Many Requests', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported', 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 510 => 'Not Extended' }
Class Attribute Summary collapse
-
.store ⇒ Object
Returns the value of attribute store.
Class Method Summary collapse
Class Attribute Details
.store ⇒ Object
Returns the value of attribute store.
71 72 73 |
# File 'lib/rpush/daemon.rb', line 71 def store @store end |
Class Method Details
.common_init ⇒ Object
117 118 119 120 |
# File 'lib/rpush/daemon.rb', line 117 def self.common_init init_store init_plugins end |
.shutdown ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/rpush/daemon.rb', line 95 def self.shutdown if Rpush.config.foreground # Eat the '^C' STDOUT.write("\b\b") STDOUT.flush end Rpush.logger.info('Shutting down... ', true) shutdown_lock.synchronize do Rpc::Server.stop Feeder.stop AppRunner.stop delete_pid_file puts Rainbow('✔').red if Rpush.config.foreground && Rpush.config.foreground_logging end end |
.shutdown_lock ⇒ Object
113 114 115 |
# File 'lib/rpush/daemon.rb', line 113 def self.shutdown_lock @shutdown_lock ||= Mutex.new end |
.start ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/rpush/daemon.rb', line 74 def self.start Process.daemon if daemonize? write_pid_file SignalHandler.start common_init Synchronizer.sync Rpc::Server.start # No further store connections will be made from this thread. store.release_connection Rpush.logger.info('Rpush operational.') show_welcome_if_needed # Blocking call, returns after Feeder.stop is called from another thread. Feeder.start # Wait for shutdown to complete. shutdown_lock.synchronize { true } end |