Class: DispatchQueue

Inherits:
Object
  • Object
show all
Defined in:
lib/dispatch_queue.rb

Constant Summary collapse

VERSION =
"1.1.0"

Class Method Summary collapse

Class Method Details

.[](*procs) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/dispatch_queue.rb', line 4

def self.[](*procs)
  procs.map { |proc|
    Thread.new{ proc.to_proc.call }
  }.map { |thread|
    thread.value
  }
end