Class: SidekiqRobustJob::DependenciesContainer

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq_robust_job/dependencies_container.rb

Class Method Summary collapse

Class Method Details

.[](method_name) ⇒ Object



3
4
5
# File 'lib/sidekiq_robust_job/dependencies_container.rb', line 3

def self.[](method_name)
  public_send(method_name)
end

.digest_generatorObject



32
33
34
35
36
# File 'lib/sidekiq_robust_job/dependencies_container.rb', line 32

def self.digest_generator
  SidekiqRobustJob::DigestGenerator.new(
    backend: SidekiqRobustJob.configuration.digest_generator_backend
  )
end

.enqueue_conflict_resolution_resolverObject



38
39
40
41
42
43
# File 'lib/sidekiq_robust_job/dependencies_container.rb', line 38

def self.enqueue_conflict_resolution_resolver
  SidekiqRobustJob::EnqueueConflictResolutionStrategy.new(
    jobs_repository: SidekiqRobustJob::DependenciesContainer["jobs_repository"],
    clock: SidekiqRobustJob.configuration.clock
  )
end

.jobs_repositoryObject



16
17
18
19
20
21
# File 'lib/sidekiq_robust_job/dependencies_container.rb', line 16

def self.jobs_repository
  SidekiqRobustJob::Repository.new(
    jobs_database: SidekiqRobustJob.configuration.sidekiq_job_model,
    clock: SidekiqRobustJob.configuration.clock
  )
end

.missed_jobsObject



49
50
51
52
53
54
# File 'lib/sidekiq_robust_job/dependencies_container.rb', line 49

def self.missed_jobs
  SidekiqRobustJob::MissedJobs.new(
    jobs_repository: SidekiqRobustJob::DependenciesContainer["jobs_repository"],
    missed_job_policy: SidekiqRobustJob.configuration.missed_job_policy
  )
end

.missed_jobs_schedulerObject



56
57
58
59
60
61
62
# File 'lib/sidekiq_robust_job/dependencies_container.rb', line 56

def self.missed_jobs_scheduler
  SidekiqRobustJob::MissedJobsScheduler.new(
    cron: SidekiqRobustJob.configuration.missed_job_cron,
    scheduled_jobs_repository: Sidekiq::Cron::Job,
    job_class: SidekiqRobustJob::PerformMissedJobsJob
  )
end

.setter_proxy_jobObject



45
46
47
# File 'lib/sidekiq_robust_job/dependencies_container.rb', line 45

def self.setter_proxy_job
  SidekiqRobustJob::SetterProxyJob.new
end

.sidekiq_job_managerObject



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

def self.sidekiq_job_manager
  SidekiqRobustJob::SidekiqJobManager.new(
    jobs_repository: SidekiqRobustJob::DependenciesContainer["jobs_repository"],
    clock: SidekiqRobustJob.configuration.clock,
    digest_generator: SidekiqRobustJob::DependenciesContainer["digest_generator"],
    memory_monitor: SidekiqRobustJob.configuration.memory_monitor
  )
end

.uniqueness_strategy_resolverObject



23
24
25
26
27
28
29
30
# File 'lib/sidekiq_robust_job/dependencies_container.rb', line 23

def self.uniqueness_strategy_resolver
  SidekiqRobustJob::UniquenessStrategy.new(
    locker: SidekiqRobustJob.configuration.locker,
    lock_ttl_proc: SidekiqRobustJob.configuration.lock_ttl_proc,
    jobs_repository: SidekiqRobustJob::DependenciesContainer["jobs_repository"],
    memory_monitor: SidekiqRobustJob.configuration.memory_monitor
  )
end