Class: JRubyParallelProcessing::DistributedWorker::PrioritizedTask

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/jruby_parallel_processing/distributed_worker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task, priority) ⇒ PrioritizedTask

Returns a new instance of PrioritizedTask.



74
75
76
77
# File 'lib/jruby_parallel_processing/distributed_worker.rb', line 74

def initialize(task, priority)
  @task = task
  @priority = priority
end

Instance Attribute Details

#priorityObject (readonly)

Returns the value of attribute priority.



72
73
74
# File 'lib/jruby_parallel_processing/distributed_worker.rb', line 72

def priority
  @priority
end

#taskObject (readonly)

Returns the value of attribute task.



72
73
74
# File 'lib/jruby_parallel_processing/distributed_worker.rb', line 72

def task
  @task
end

Instance Method Details

#<=>(other) ⇒ Object



79
80
81
# File 'lib/jruby_parallel_processing/distributed_worker.rb', line 79

def <=>(other)
  other.priority <=> @priority 
end