Sha256: 9d1f3a091a54e606495de94d3b1cfdf613dd4bb8417e778c89aa25252e244116

Contents?: true

Size: 450 Bytes

Versions: 1

Compression:

Stored size: 450 Bytes

Contents

# frozen_string_literal: true

require_relative "basket/batcher"
require_relative "basket/hash_backend"
require_relative "basket/queue"
require_relative "basket/version"

module Basket
  class Error < StandardError; end

  def self.add(queue, data)
    queue_length = Basket::Queue.push(queue, data)
    queue_class = queue.constantize.new
    return unless queue_length == queue_class.batcher.options.queue_length

    queue_class.perform
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
basket-0.0.1 lib/basket.rb