Module: CronoTrigger

Defined in:
lib/crono_trigger.rb,
lib/crono_trigger/web.rb,
lib/crono_trigger/events.rb,
lib/crono_trigger/worker.rb,
lib/crono_trigger/railtie.rb,
lib/crono_trigger/version.rb,
lib/crono_trigger/schedulable.rb,
lib/crono_trigger/models/signal.rb,
lib/crono_trigger/models/worker.rb,
lib/crono_trigger/polling_thread.rb,
lib/crono_trigger/models/execution.rb,
lib/crono_trigger/exception_handler.rb,
lib/crono_trigger/execution_tracker.rb,
lib/crono_trigger/global_exception_handler.rb,
lib/generators/crono_trigger/model/model_generator.rb,
lib/generators/crono_trigger/install/install_generator.rb,
lib/generators/crono_trigger/migration/migration_generator.rb

Defined Under Namespace

Modules: Events, Generators, Models, Schedulable, Worker Classes: ExceptionHandler, ExecutionTracker, GlobalExceptionHandler, PollingThread, Railtie, Web

Constant Summary collapse

VERSION =
"0.8.3"

Class Method Summary collapse

Class Method Details

.configObject



33
34
35
# File 'lib/crono_trigger.rb', line 33

def self.config
  @config
end

.configure {|config| ... } ⇒ Object

Yields:



37
38
39
# File 'lib/crono_trigger.rb', line 37

def self.configure
  yield config
end

.load_config(yml, environment = nil) ⇒ Object



51
52
53
54
55
56
# File 'lib/crono_trigger.rb', line 51

def self.load_config(yml, environment = nil)
  config = YAML.load_file(yml)[environment || "default"]
  config.each do |k, v|
    @config[k] = v
  end
end

.reloaderObject



41
42
43
# File 'lib/crono_trigger.rb', line 41

def self.reloader
  @reloader
end

.reloader=(reloader) ⇒ Object



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

def self.reloader=(reloader)
  @reloader = reloader
end

.retry_on_db_errorsObject



62
63
64
65
66
# File 'lib/crono_trigger.rb', line 62

def self.retry_on_db_errors
  Retriable.retriable(CronoTrigger.config.db_error_retriable_options) do
    yield
  end
end

.workersObject



58
59
60
# File 'lib/crono_trigger.rb', line 58

def self.workers
  CronoTrigger::Models::Worker.alive_workers
end