Module: Kernel
- Defined in:
- lib/asynchronous/kernel.rb
Overview
kernel method for asyncron calls basic version is :
var= async { “ruby Code here” } var.value #> “ruby Code here”
or
var = async :parallelism do
"some awsome ruby code here!"
end
Instance Method Summary collapse
Instance Method Details
#async(type = :Concurrency, &block) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/asynchronous/kernel.rb', line 14 def async(type= :Concurrency ,&block) case type.to_s.downcase[0] # Concurrency / VM / Green when "c","v","g" begin Asynchronous::Concurrency.new(block) end # Parallelism / OS / Native when "p","o","n" begin Asynchronous::Parallelism.new(block) end else begin Asynchronous::Concurrency.new(block) end end end |