Module: Rpush
- Defined in:
- lib/rpush.rb,
lib/rpush.rb,
lib/rpush/app.rb,
lib/rpush/push.rb,
lib/rpush/embed.rb,
lib/rpush/daemon.rb,
lib/rpush/logger.rb,
lib/rpush/adm/app.rb,
lib/rpush/gcm/app.rb,
lib/rpush/version.rb,
lib/rpush/apns/app.rb,
lib/rpush/notifier.rb,
lib/rpush/wpns/app.rb,
lib/rpush/daemon/adm.rb,
lib/rpush/daemon/gcm.rb,
lib/rpush/reflection.rb,
lib/rpush/daemon/apns.rb,
lib/rpush/daemon/wpns.rb,
lib/rpush/deprecation.rb,
lib/rpush/daemon/batch.rb,
lib/rpush/deprecatable.rb,
lib/rpush/notification.rb,
lib/rpush/apns/feedback.rb,
lib/rpush/apns_feedback.rb,
lib/rpush/configuration.rb,
lib/rpush/daemon/feeder.rb,
lib/rpush/daemon/delivery.rb,
lib/rpush/daemon/loggable.rb,
lib/rpush/adm/notification.rb,
lib/rpush/daemon/constants.rb,
lib/rpush/gcm/notification.rb,
lib/rpush/apns/notification.rb,
lib/rpush/daemon/app_runner.rb,
lib/rpush/multi_json_helper.rb,
lib/rpush/wpns/notification.rb,
lib/rpush/adm/data_validator.rb,
lib/rpush/daemon/reflectable.rb,
lib/rpush/daemon/adm/delivery.rb,
lib/rpush/daemon/gcm/delivery.rb,
lib/rpush/daemon/apns/delivery.rb,
lib/rpush/daemon/wpns/delivery.rb,
lib/rpush/daemon/delivery_error.rb,
lib/rpush/daemon/dispatcher/tcp.rb,
lib/rpush/daemon/tcp_connection.rb,
lib/rpush/daemon/dispatcher/http.rb,
lib/rpush/daemon/dispatcher_loop.rb,
lib/rpush/daemon/retryable_error.rb,
lib/rpush/daemon/interruptible_sleep.rb,
lib/rpush/daemon/retry_header_parser.rb,
lib/rpush/daemon/store/active_record.rb,
lib/rpush/payload_data_size_validator.rb,
lib/rpush/daemon/apns/feedback_receiver.rb,
lib/rpush/daemon/service_config_methods.rb,
lib/rpush/daemon/too_many_requests_error.rb,
lib/rpush/daemon/apns/disconnection_error.rb,
lib/rpush/registration_ids_count_validator.rb,
lib/rpush/daemon/dispatcher_loop_collection.rb,
lib/rpush/apns/binary_notification_validator.rb,
lib/rpush/apns/device_token_format_validator.rb,
lib/rpush/daemon/apns/certificate_expired_error.rb,
lib/rpush/daemon/store/active_record/reconnectable.rb,
lib/rpush/gcm/expiry_collapse_key_mutual_inclusion_validator.rb
Defined Under Namespace
Modules: Adm, Apns, Daemon, Deprecatable, Gcm, MultiJsonHelper, Wpns
Classes: App, Configuration, ConfigurationWithoutDefaults, DeliveryError, Deprecation, Logger, Notification, Notifier, PayloadDataSizeValidator, Reflections, RegistrationIdsCountValidator, RetryableError, TooManyRequestsError
Constant Summary
collapse
- VERSION =
'1.0.0'
- CONFIG_ATTRS =
[:foreground, :push_poll, :feedback_poll, :embedded,
:check_for_errors, :pid_file, :batch_size, :push, :store, :logger,
:batch_storage_updates, :wakeup]
Class Method Summary
collapse
Class Method Details
.attr_accessible_available? ⇒ Boolean
5
6
7
8
|
# File 'lib/rpush.rb', line 5
def self.attr_accessible_available?
require 'rails'
::Rails::VERSION::STRING < '4'
end
|
.config ⇒ Object
2
3
4
|
# File 'lib/rpush/configuration.rb', line 2
def self.config
@config ||= Rpush::Configuration.new
end
|
6
7
8
|
# File 'lib/rpush/configuration.rb', line 6
def self.configure
yield config if block_given?
end
|
.embed(options = {}) ⇒ Object
.jruby? ⇒ Boolean
47
48
49
|
# File 'lib/rpush.rb', line 47
def self.jruby?
defined? JRUBY_VERSION
end
|
.logger ⇒ Object
55
56
57
|
# File 'lib/rpush.rb', line 55
def self.logger
@logger ||= Logger.new(:foreground => Rpush.config.foreground)
end
|
.logger=(logger) ⇒ Object
59
60
61
|
# File 'lib/rpush.rb', line 59
def self.logger=(logger)
@logger = logger
end
|
.notifier ⇒ Object
Default notifier instance. This uses the :connect, :port values in Rpush.config.wakeup to connect to the wakeup socket in the Rpush Daemon. It will fall back to :host, :port if :connect is not specified.
.push(options = {}) ⇒ Object
.reflect {|reflections| ... } ⇒ Object
2
3
4
|
# File 'lib/rpush/reflection.rb', line 2
def self.reflect
yield reflections if block_given?
end
|
.reflections ⇒ Object
6
7
8
|
# File 'lib/rpush/reflection.rb', line 6
def self.reflections
@reflections ||= Reflections.new
end
|
.require_for_daemon ⇒ Object
51
52
53
|
# File 'lib/rpush.rb', line 51
def self.require_for_daemon
require 'rpush/daemon'
end
|
.wakeup ⇒ Object
Call this from a client application after saving a Notification to the database to wakeup the Rpush Daemon to deliver the notification immediately.
38
39
40
|
# File 'lib/rpush/notifier.rb', line 38
def self.wakeup
notifier.notify
end
|