Module: Workhorse

Extended by:
Enqueuer
Defined in:
lib/workhorse.rb,
lib/workhorse/pool.rb,
lib/workhorse/daemon.rb,
lib/workhorse/db_job.rb,
lib/workhorse/poller.rb,
lib/workhorse/worker.rb,
lib/workhorse/enqueuer.rb,
lib/workhorse/performer.rb,
lib/workhorse/scoped_env.rb,
lib/workhorse/active_job_extension.rb,
lib/workhorse/daemon/shell_handler.rb,
lib/generators/workhorse/install_generator.rb

Defined Under Namespace

Modules: ActiveJobExtension, Enqueuer, Jobs Classes: Daemon, DbJob, InstallGenerator, Performer, Poller, Pool, ScopedEnv, Worker

Constant Summary collapse

AREL_GTE_7 =

Check if the available Arel version is greater or equal than 7.0.0

Gem::Version.new(Arel::VERSION) >= Gem::Version.new('7.0.0')

Class Method Summary collapse

Methods included from Enqueuer

enqueue, enqueue_active_job, enqueue_op

Class Method Details

.performerObject

Returns the performer currently performing the active job. This can only be called from within a job and the same thread.



19
20
21
22
# File 'lib/workhorse.rb', line 19

def self.performer
  Thread.current[:workhorse_current_performer] \
    || fail('No performer is associated with the current thread. This method must always be called inside of a job.')
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Workhorse)

    the object that the method was called on



84
85
86
# File 'lib/workhorse.rb', line 84

def self.setup
  yield self
end