Module: SwitchmanInstJobs

Defined in:
lib/switchman_inst_jobs.rb,
lib/switchman_inst_jobs/engine.rb,
lib/switchman_inst_jobs/version.rb,
lib/switchman_inst_jobs/new_relic.rb,
lib/switchman_inst_jobs/guard_rail.rb,
lib/switchman_inst_jobs/timed_cache.rb,
lib/switchman_inst_jobs/delayed/pool.rb,
lib/switchman_inst_jobs/jobs_migrator.rb,
lib/switchman_inst_jobs/delayed/worker.rb,
lib/switchman_inst_jobs/switchman/shard.rb,
lib/switchman_inst_jobs/yaml_extensions.rb,
lib/switchman_inst_jobs/delayed/settings.rb,
lib/switchman_inst_jobs/delayed/backend/base.rb,
lib/switchman_inst_jobs/active_record/migration.rb,
lib/switchman_inst_jobs/delayed/message_sending.rb,
lib/switchman_inst_jobs/switchman/default_shard.rb,
lib/switchman_inst_jobs/switchman/database_server.rb,
lib/switchman_inst_jobs/delayed/worker/health_check.rb,
lib/switchman_inst_jobs/active_record/connection_adapters/connection_pool.rb,
lib/switchman_inst_jobs/active_record/connection_adapters/postgresql_adapter.rb

Defined Under Namespace

Modules: ActiveRecord, Delayed, GuardRail, NewRelic, PsychExt, Switchman Classes: Engine, JobsMigrator, ShardNotFoundError, TimedCache

Constant Summary collapse

VERSION =
'4.0.3'.freeze

Class Method Summary collapse

Class Method Details

.initialize_active_recordObject



7
8
9
10
11
12
13
14
# File 'lib/switchman_inst_jobs.rb', line 7

def self.initialize_active_record
  ::ActiveRecord::ConnectionAdapters::ConnectionPool.prepend(
    ActiveRecord::ConnectionAdapters::ConnectionPool
  )
  ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(
    ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
  )
end

.initialize_guard_railObject



27
28
29
# File 'lib/switchman_inst_jobs.rb', line 27

def self.initialize_guard_rail
  ::GuardRail.singleton_class.prepend GuardRail::ClassMethods
end

.initialize_inst_jobsObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/switchman_inst_jobs.rb', line 16

def self.initialize_inst_jobs
  ::Delayed::Backend::ActiveRecord::Job.prepend(
    Delayed::Backend::Base
  )
  ::Delayed::Pool.prepend Delayed::Pool
  ::Delayed::Worker.prepend Delayed::Worker
  ::Delayed::Worker::HealthCheck.prepend Delayed::Worker::HealthCheck
  ::SwitchmanInstJobs::NewRelic.enable
  ::Object.include Delayed::MessageSending
end

.initialize_switchmanObject



31
32
33
34
35
# File 'lib/switchman_inst_jobs.rb', line 31

def self.initialize_switchman
  ::Switchman::DatabaseServer.prepend Switchman::DatabaseServer
  ::Switchman::DefaultShard.prepend Switchman::DefaultShard
  ::Switchman::Shard.prepend Switchman::Shard
end