Class: JRubyParallelProcessing::DistributedWorker::PrioritizedTask
- Inherits:
-
Object
- Object
- JRubyParallelProcessing::DistributedWorker::PrioritizedTask
- Includes:
- Comparable
- Defined in:
- lib/jruby_parallel_processing/distributed_worker.rb
Instance Attribute Summary collapse
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(task, priority) ⇒ PrioritizedTask
constructor
A new instance of PrioritizedTask.
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
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
72 73 74 |
# File 'lib/jruby_parallel_processing/distributed_worker.rb', line 72 def priority @priority end |
#task ⇒ Object (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 |