Sha256: 23c73751e0b717bb2fe052f03cf2119221294dba08d1a9d2d266f5153fa3e5d0
Contents?: true
Size: 483 Bytes
Versions: 38
Compression:
Stored size: 483 Bytes
Contents
# frozen_string_literal: true require 'fileutils' require_relative '../core/thread_pool' ::File.singleton_class.instance_eval do alias_method :orig_stat, :stat # Offloads `File.stat` to the default thread pool. def stat(path) ThreadPool.process { orig_stat(path) } end end ::IO.singleton_class.instance_eval do alias_method :orig_read, :read # Offloads `IO.read` to the default thread pool. def read(path) ThreadPool.process { orig_read(path) } end end
Version data entries
38 entries across 38 versions & 1 rubygems