Sha256: 5f154e4a2fb0f91b264d4a69a25bdd1c18279c6c0279c58f4a33bfffab2d9cf7

Contents?: true

Size: 369 Bytes

Versions: 7

Compression:

Stored size: 369 Bytes

Contents

module AsyncRequest
  module ApplicationHelper
    def execute_async(worker_class, *params)
      raise ArgumentError if worker_class.nil?
      job = Job.create(
        worker: worker_class,
        params: params,
        status: Job.statuses[:waiting],
        uid: SecureRandom.uuid
      )
      JobProcessor.perform_async(job.id)
      job.uid
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
async_request-0.0.7 app/helpers/async_request/application_helper.rb
async_request-0.0.6 app/helpers/async_request/application_helper.rb
async_request-0.0.5 app/helpers/async_request/application_helper.rb
async_request-0.0.4 app/helpers/async_request/application_helper.rb
async_request-0.0.3 app/helpers/async_request/application_helper.rb
async_request-0.0.2 app/helpers/async_request/application_helper.rb
async_request-0.0.1 app/helpers/async_request/application_helper.rb