Sha256: f4be6da84d85c997824f1c863ada86968518ea199ccbf088a3cd53a97aa89692

Contents?: true

Size: 410 Bytes

Versions: 1

Compression:

Stored size: 410 Bytes

Contents

# frozen_string_literal: true

module Pull
  class Infinity
    DEFAULT_ABORT_PROC = -> () {
      puts "abort abort"
    }

    def initialize(on_abort = DEFAULT_ABORT_PROC)
      @index = 0
    end

    def call
      -> (finish, callback) {
        if finish
          on_abort.()
          return nil
        end

        callback.(@index)
        @index += 1
        return true
      }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pull_stream-1.0.0 lib/pull/source/infinity.rb