Class: Celluloid::Internals::TaskSet
- Inherits:
-
Object
- Object
- Celluloid::Internals::TaskSet
- Extended by:
- Forwardable
- Includes:
- JRuby::Synchronized
- Defined in:
- lib/celluloid/internals/task_set.rb,
lib/celluloid/internals/task_set.rb
Instance Method Summary collapse
- #<<(task) ⇒ Object
- #delete(task) ⇒ Object
- #empty? ⇒ Boolean
- #first ⇒ Object
-
#initialize ⇒ TaskSet
constructor
A new instance of TaskSet.
- #to_a ⇒ Object
Constructor Details
#initialize ⇒ TaskSet
Returns a new instance of TaskSet.
15 16 17 |
# File 'lib/celluloid/internals/task_set.rb', line 15 def initialize @tasks = Set.new end |
Instance Method Details
#<<(task) ⇒ Object
25 26 27 |
# File 'lib/celluloid/internals/task_set.rb', line 25 def <<(task) Rubinius.synchronize(self) { @tasks << task } end |
#delete(task) ⇒ Object
29 30 31 |
# File 'lib/celluloid/internals/task_set.rb', line 29 def delete(task) Rubinius.synchronize(self) { @tasks.delete task } end |
#empty? ⇒ Boolean
37 38 39 |
# File 'lib/celluloid/internals/task_set.rb', line 37 def empty? Rubinius.synchronize(self) { @tasks.empty? } end |
#first ⇒ Object
33 34 35 |
# File 'lib/celluloid/internals/task_set.rb', line 33 def first Rubinius.synchronize(self) { @tasks.first } end |
#to_a ⇒ Object
41 42 43 |
# File 'lib/celluloid/internals/task_set.rb', line 41 def to_a Rubinius.synchronize(self) { @tasks.to_a } end |