Sha256: 6cd3f45694709884db72dd7965d517b37cdd263d8175f7d7b28650e0e4690bfa

Contents?: true

Size: 592 Bytes

Versions: 3

Compression:

Stored size: 592 Bytes

Contents

require File.join(File.dirname(__FILE__), 'helper')

class Step1 < Pipeline::Stage::Base
  def run
    puts("Started step 1")
    puts("Raising user-recoverable error")
    raise Pipeline::RecoverableError.new("require your action", true)
  end
end

class Step2 < Pipeline::Stage::Base
  def run
    puts("Started step 2")
    sleep 3
    puts("Finished step 2")
  end
end

class TwoStepPipeline < Pipeline::Base
  define_stages Step1 >> Step2
end

id = Pipeline.start(TwoStepPipeline.new)

Delayed::Job.work_off

Pipeline.cancel(id)
puts("Pipeline is now #{Pipeline::Base.find(id).status}")

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
dtsato-pipeline-0.0.8 examples/cancelling_pipeline.rb
pipeline-0.0.9 examples/cancelling_pipeline.rb
pipeline-0.0.8 examples/cancelling_pipeline.rb