Sha256: 2bbc488aabd16289c95722824e1faa58014e35c66edcc61d76bd9a52a42ceb83

Contents?: true

Size: 346 Bytes

Versions: 1

Compression:

Stored size: 346 Bytes

Contents

class Future < Thread
  VERSION = "1.0.0"

  def self.all(futures)
    Future { futures.map(&:value) }
  end

  def to_s
    case status
    when nil
      "#<#{self.class} (errored)>"
    when false
      "#<#{self.class} value=#{value}>"
    else
      "#<#{self.class} (incomplete)>"
    end
  end
end

def Future(&bk)
  Future.start(&bk)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
future.rb-1.0.0 lib/future.rb