Skip to content

Implementing your own storage backend

ahmozkya edited this page Oct 10, 2014 · 2 revisions

Rpush does not currently support storage backends other than ActiveRecord, but you can implement your own.

You need to assign to Rpush::Daemon.store your own object that implements the API as defined for Rpush::Daemon::Store::ActiveRecord.

For example, in config/initializers/rpush.rb:

require 'rpush/daemon'
Rpush::Daemon.store = MyStore.new

It is vital that you respect the apps argument passed to deliverable_notifications. Failure to do so will result in the delivery of notifications multiple times. This is due to a design feature that allows high throughput apps to not affect the delivery rate of lower throughout apps.