Class: Hydra::RemoteTask

Inherits:
Task
  • Object
show all
Includes:
Open3
Defined in:
lib/hydra/tasks.rb

Overview

Setup a task that will be run across all remote workers

Hydra::RemoteTask.new('db:reset')

Then you can run:

rake hydra:remote:db:reset

Instance Attribute Summary

Attributes inherited from Task

#autosort, #config, #environment, #files, #listeners, #name, #options, #runner_log_file, #serial, #show_time, #verbose

Instance Method Summary collapse

Methods inherited from Task

#add_files, #find_config_file

Constructor Details

#initialize(name, command = nil) {|_self| ... } ⇒ RemoteTask

Create a new hydra remote task with the given name. The task will be named hydra:remote:<name>

Yields:

  • (_self)

Yield Parameters:


269
270
271
272
273
274
275
276
277
278
279
# File 'lib/hydra/tasks.rb', line 269

def initialize(name, command=nil)
  @name = name
  @command = command
  yield self if block_given?
  @config = find_config_file
  if @config
    define
  else
    task "hydra:remote:#{@name}" do ; end
  end
end