Sha256: ce0d061856fabd3ba33d01a030f4a398db312e040063a58f9546b819ecc3c486

Contents?: true

Size: 324 Bytes

Versions: 1

Compression:

Stored size: 324 Bytes

Contents

# frozen_string_literal: true

# Extensions to the Enumerator class
class ::Enumerator
  alias_method :orig_next, :next
  def next
    Fiber.current.thread ||= Thread.current
    orig_next
  end

  alias_method :orig_each, :each
  def each(*a, &b)
    Fiber.current.thread ||= Thread.current
    orig_each(*a, &b)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polyphony-0.95 lib/polyphony/extensions/enumerator.rb