Sha256: f36756dfb55b44c597481caaba45d6ff41a29269c50454f0a3822741293602a6

Contents?: true

Size: 684 Bytes

Versions: 11

Compression:

Stored size: 684 Bytes

Contents

# frozen_string_literal: true

require_relative "tools/version"

require "async"
require "async/notification"
require "async/semaphore"

require "zeitwerk"

loader = Zeitwerk::Loader.new
loader.tag = File.basename(__FILE__, ".rb")
loader.inflector = Zeitwerk::GemInflector.new(__FILE__)
loader.push_dir(File.expand_path("..", __dir__.to_s))
loader.setup

module Async
  # Your code goes here...
  module Tools # rubocop:disable Style/ClassAndModuleChildren
    class Error < StandardError
    end
  end

  def self.map(collection, **params, &)
    WorkerPool.with(queue_limit: collection.count, **params) do |pool|
      pool.schedule_all(collection, &).map(&:wait)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
async-tools-0.1.10 lib/async/tools.rb
async-tools-0.1.9 lib/async/tools.rb
async-tools-0.1.8 lib/async/tools.rb
async-tools-0.1.7 lib/async/tools.rb
async-tools-0.1.6 lib/async/tools.rb
async-tools-0.1.5 lib/async/tools.rb
async-tools-0.1.4 lib/async/tools.rb
async-tools-0.1.3 lib/async/tools.rb
async-tools-0.1.2 lib/async/tools.rb
async-tools-0.1.1 lib/async/tools.rb
async-tools-0.1.0 lib/async/tools.rb