Sha256: 7d6dc56cd67870ba7a64c2eec450e09a9d5a6db79101f98bfbbc020180e54742

Contents?: true

Size: 685 Bytes

Versions: 2

Compression:

Stored size: 685 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

2 entries across 2 versions & 1 rubygems

Version Path
async-tools-0.2.2 lib/async/tools.rb
async-tools-0.2.1 lib/async/tools.rb