Class: Celluloid::TaskSet

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
JRuby::Synchronized
Defined in:
lib/celluloid/task_set.rb,
lib/celluloid/task_set.rb

Instance Method Summary collapse

Constructor Details

#initializeTaskSet

Returns a new instance of TaskSet.


14
15
16
# File 'lib/celluloid/task_set.rb', line 14

def initialize
  @tasks = Set.new
end

Instance Method Details

#<<(task) ⇒ Object


24
25
26
# File 'lib/celluloid/task_set.rb', line 24

def <<(task)
  Rubinius.synchronize(self) { @tasks << task }
end

#delete(task) ⇒ Object


28
29
30
# File 'lib/celluloid/task_set.rb', line 28

def delete(task)
  Rubinius.synchronize(self) { @tasks.delete task }
end

#empty?Boolean

Returns:

  • (Boolean)

36
37
38
# File 'lib/celluloid/task_set.rb', line 36

def empty?
  Rubinius.synchronize(self) { @tasks.empty? }
end

#firstObject


32
33
34
# File 'lib/celluloid/task_set.rb', line 32

def first
  Rubinius.synchronize(self) { @tasks.first }
end

#to_aObject


40
41
42
# File 'lib/celluloid/task_set.rb', line 40

def to_a
  Rubinius.synchronize(self) { @tasks.to_a }
end