Sha256: de9f0efec088c7121220738492aa600ba6c5d9f951227463e7505e03c4bd9b02

Contents?: true

Size: 521 Bytes

Versions: 4

Compression:

Stored size: 521 Bytes

Contents

# 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
#
module Kernel
  def async(type= :Concurrency ,&block)
    type= type.to_s
    case type.downcase[0]
      when "c"
        begin
          Asynchronous::Concurrency.new(block)
        end
      when "p"
        begin
          Asynchronous::Parallelism.new(block)
        end
      else
        nil

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
asynchronous-1.0.1 lib/asynchronous/kernel.rb
asynchronous-1.0.0 lib/asynchronous/kernel.rb
asynchronous-0.1.1 lib/asynchronous/kernel.rb
asynchronous-0.1.0 lib/asynchronous/kernel.rb