module Postjob::Workflow

This module defines the interface available for workflow modules.

This module is extended into the actual workflow module during registering.

Public Instance Methods

async(runner, *args, timeout: nil, max_attempts: nil, queue: nil) click to toggle source

see Postjob::Runner.async

# File lib/postjob/workflow.rb, line 18
def async(runner, *args, timeout: nil, max_attempts: nil, queue: nil)
  ::Postjob::Runner.async(runner, *args, timeout: timeout, max_attempts: max_attempts, queue: queue)
end
await(job, *args, timeout: nil, max_attempts: nil) click to toggle source

see Postjob::Runner.await

# File lib/postjob/workflow.rb, line 23
def await(job, *args, timeout: nil, max_attempts: nil)
  ::Postjob::Runner.await(job, *args, timeout: timeout, max_attempts: max_attempts)
end
workflow_token(job) click to toggle source

see Postjob::Runner.workflow_token

# File lib/postjob/workflow.rb, line 28
def workflow_token(job)
  expect! job.parent_id => ::Postjob::Runner.current_job.id
  ::Postjob::Queue.find_or_create_token(job)
end