Class: Celluloid::Internals::TaskSet

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

Instance Method Summary collapse

Constructor Details

#initializeTaskSet

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

Returns:

  • (Boolean)


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

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

#firstObject



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

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

#to_aObject



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

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