class Orchestrated::Orchestration
Public Class Methods
create( value, sym, args, prerequisite)
click to toggle source
Actually creates a completion (wrapper). Not exactly an orchestration—ssh…
# File lib/orchestrated/orchestration.rb, line 87 def self.create( value, sym, args, prerequisite) # wee! static analysis FTW! raise ArgumentError.new('prerequisite can never be complete') if prerequisite.never_complete? prerequisite.save! OrchestrationCompletion.new.tap do |completion| completion.orchestration = new.tap do |orchestration| orchestration.handler = Handler.new( value, sym, args) orchestration.save! interest = OrchestrationInterest.new.tap do |interest| interest.prerequisite = prerequisite interest.orchestration = orchestration interest.save! end # interest # interest linkage can often change orchestration state so we have to reload here orchestration.reload end # orchestration completion.save! end # completion end
Public Instance Methods
complete?()
click to toggle source
# File lib/orchestrated/orchestration.rb, line 36 def complete? false end
dequeue()
click to toggle source
# File lib/orchestrated/orchestration.rb, line 111 def dequeue self.delayed_job.destroy end
enqueue()
click to toggle source
# File lib/orchestrated/orchestration.rb, line 107 def enqueue self.delayed_job = Delayed::Job.enqueue( MessageDelivery.new( handler.value, handler.sym, handler.args, self.id) ) end