Module: Qyu

Defined in:
lib/qyu/ui.rb,
lib/qyu.rb,
lib/qyu/utils.rb,
lib/qyu/config.rb,
lib/qyu/factory.rb,
lib/qyu/version.rb,
lib/qyu/workers.rb,
lib/qyu/models/job.rb,
lib/qyu/queue/base.rb,
lib/qyu/store/base.rb,
lib/qyu/errors/base.rb,
lib/qyu/models/task.rb,
lib/qyu/workers/base.rb,
lib/qyu/workers/sync.rb,
lib/qyu/workers/split.rb,
lib/qyu/models/workflow.rb,
lib/qyu/errors/unsync_error.rb,
lib/qyu/models/enums/status.rb,
lib/qyu/errors/job_not_found.rb,
lib/qyu/queue/memory/adapter.rb,
lib/qyu/store/memory/adapter.rb,
lib/qyu/errors/task_not_found.rb,
lib/qyu/ui/helpers/pagination.rb,
lib/qyu/workers/concerns/split.rb,
lib/qyu/errors/lock_not_acquired.rb,
lib/qyu/workers/concerns/timeout.rb,
lib/qyu/errors/invalid_queue_name.rb,
lib/qyu/errors/workflow_not_found.rb,
lib/qyu/workers/concerns/callback.rb,
lib/qyu/errors/could_not_fetch_task.rb,
lib/qyu/errors/message_not_received.rb,
lib/qyu/errors/lock_already_acquired.rb,
lib/qyu/errors/not_implemented_error.rb,
lib/qyu/errors/invalid_task_attributes.rb,
lib/qyu/workers/concerns/failure_queue.rb,
lib/qyu/errors/missing_split_parameters.rb,
lib/qyu/errors/payload_validation_error.rb,
lib/qyu/errors/task_status_update_failed.rb,
lib/qyu/errors/unknown_validation_option.rb,
lib/qyu/workers/concerns/payload_validator.rb,
lib/qyu/errors/invalid_worker_configuration_value.rb,
lib/qyu/errors/workflow_descriptor_validation_error.rb,
lib/qyu/models/concerns/workflow_descriptor_validator.rb

Overview

:nodoc: all

Defined Under Namespace

Modules: Concerns, Errors, Helpers, Queue, Store, Utils, Workers Classes: Config, Factory, Job, Status, Task, UI, Workflow

Constant Summary collapse

VERSION =
'1.1.0'
Worker =
Qyu::Workers::Base
SplitWorker =
Qyu::Workers::Split
SyncWorker =
Qyu::Workers::Sync

Class Method Summary collapse

Class Method Details

.configObject Also known as: configuration


27
28
29
30
31
# File 'lib/qyu.rb', line 27

def config
  fail 'Undefined configuration' unless defined?(@@__config)

  @@__config
end

.configure(queue:, store:, logger: nil) ⇒ Object


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

def configure(queue:, store:, logger: nil)
  self.config = Qyu::Config.new(
    queue: queue,
    store: store
  )
  self.logger = logger || default_logger unless defined?(@@__logger)
  self.test_connections
end

.configured?Boolean


34
35
36
# File 'lib/qyu.rb', line 34

def configured?
  defined?(@@__config)
end

.loggerObject


42
43
44
# File 'lib/qyu.rb', line 42

def logger
  @@__logger ||= default_logger
end

.logger=(logger) ⇒ Object


38
39
40
# File 'lib/qyu.rb', line 38

def logger=(logger)
  @@__logger = logger
end

.queueObject


46
47
48
# File 'lib/qyu.rb', line 46

def queue
  @@__queue ||= Qyu::Factory::QueueFactory.get(config.queue)
end

.storeObject


50
51
52
# File 'lib/qyu.rb', line 50

def store
  @@__store ||= Qyu::Factory::StoreFactory.get(config.store)
end

.test_connectionsObject


54
55
56
57
# File 'lib/qyu.rb', line 54

def test_connections
  queue
  store
end