Sha256: 39a0e0648db7fa85f5132b77baeacd52cf3d910edd4d112f76cf87913442aa59

Contents?: true

Size: 475 Bytes

Versions: 8

Compression:

Stored size: 475 Bytes

Contents

require 'singleton'
require 'gb_dispatch/manager'
class CentralDispatch
  include Singleton

  def dispatch_async(block=nil)
    GBDispatch::Manager.instance.run_async_on_queue GBDispatch::Manager.instance.get_queue do
      block ? block.call : yield
    end
  end

  class << self
    def dispatch_async(block=nil)
      GBDispatch::Manager.instance.run_async_on_queue GBDispatch::Manager.instance.get_queue do
        block ? block.call : yield
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gb_dispatch-0.1.2 lib/gb_dispatch/central_dispatch.rb
gb_dispatch-0.1.1 lib/gb_dispatch/central_dispatch.rb
gb_dispatch-0.1.0 lib/gb_dispatch/central_dispatch.rb
gb_dispatch-0.0.6 lib/gb_dispatch/central_dispatch.rb
gb_dispatch-0.0.5 lib/gb_dispatch/central_dispatch.rb
gb_dispatch-0.0.4 lib/gb_dispatch/central_dispatch.rb
gb_dispatch-0.0.3 lib/gb_dispatch/central_dispatch.rb
gb_dispatch-0.0.2 lib/gb_dispatch/central_dispatch.rb