Sha256: c23ca227e4d6c099d5df7746b395a5c689a808a3ea1ef545b34db0f1edeb10c2
Contents?: true
Size: 793 Bytes
Versions: 1
Compression:
Stored size: 793 Bytes
Contents
module Rpush def self.embed(options = {}) Rpush.require_for_daemon if @embed_thread STDERR.puts 'Rpush.embed can only be run once inside this process.' end config = Rpush::ConfigurationWithoutDefaults.new options.each { |k, v| config.send("#{k}=", v) } config.embedded = true Rpush.config.update(config) Kernel.at_exit { shutdown } @embed_thread = Thread.new { Rpush::Daemon.start } end def self.shutdown return unless Rpush.config.embedded Rpush::Daemon.shutdown @embed_thread.join if @embed_thread @embed_thread = nil end def self.sync return unless Rpush.config.embedded Rpush::Daemon::AppRunner.sync end def self.debug return unless Rpush.config.embedded Rpush::Daemon::AppRunner.debug end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rpush-2.0.0.beta1 | lib/rpush/embed.rb |