Sha256: 3b6b5e4f13b0a14a4f2fe05f3d46dbb7519d63fe052db1c3662a7d8a34e26054
Contents?: true
Size: 1.13 KB
Versions: 31
Compression:
Stored size: 1.13 KB
Contents
module Isomorfeus module Operation class DailyTask < LucidObject STATES = %w[ready running failed] query :ready, 'state:"ready"' query :running, 'state:"running"' query :failed, 'state:"failed"' # when the task is added to the queue its added as ready # when its running, its running # when it failes, it failed, the exception attribute is filled # when it was successful, its removed from the queue attribute :operation_class_name, class: String, required: true, validate_block: proc { |v| raise 'Invalid Operation class!' unless Isomorfeus.valid_operation_class_name?(v) } attribute :props attribute :user_class_name, class: String, default: 'Anonymous' attribute :user_key, class: String, default: 'anonymous' attribute :state, class: String, required: true, index: :yes, ensure: proc { |v| Isomorfeus::Operation::DailyTask::STATES.include?(v) ? v : 'ready' } attribute :exception attribute :rtime attribute :fail, default: true def get_exception Marshal.load(exception) if exception end end end end
Version data entries
31 entries across 31 versions & 1 rubygems