Sha256: dbdb73c2676e76c7c735b9a3f08a39a63aa495707cd216a17293fcf0febbbd2a

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

require 'plezi/websockets/message_dispatch' unless defined?(::Plezi::Base::MessageDispatch)

module Plezi
   protected

  @plezi_finalize = nil
  def plezi_finalize
     if @plezi_finalize.nil?
        @plezi_finalize = true
        @plezi_finalize = 1
     end
  end
  @plezi_initialize = nil
  def self.plezi_initialize
     if @plezi_initialize.nil?
        @plezi_initialize = true
        self.hash_proc_4symstr # crerate the Proc object used for request params
        @plezi_autostart = true if @plezi_autostart.nil?
        if ENV['PL_REDIS_URL'.freeze] && !defined?(::Redis)
          puts "WARNNING: auto-scaling with redis is set using ENV['PL_REDIS_URL'.freeze]\r\n           but the Redis gem isn't included! - SCALING IS IGNORED!"
          ::Iodine.processes ||= 1
        elsif !ENV['PL_REDIS_URL'.freeze]
          ::Iodine.processes ||= 1
        end
        ::Iodine.processes ||= 4
        at_exit do
           next if @plezi_autostart == false
           ::Iodine::Rack.app = ::Plezi.app
           ::Iodine.start
        end
     end
     true
  end
end

::Iodine.threads ||= 16
# ::Iodine.processes ||= (ENV['PL_REDIS_URL'.freeze] ? 4 : 1)
::Iodine.run { ::Plezi::Base::MessageDispatch._init }

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
plezi-0.14.9 lib/plezi/activation.rb
plezi-0.14.8 lib/plezi/activation.rb