Created
July 30, 2023 11:07
-
-
Save fxn/2054032ff038b2bbe1f30aa6d06f0242 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autoload :Date, 'date' | |
module Kernel | |
alias_method :original_require, :require | |
def require(path) | |
puts "Require invoked for #{path}" | |
original_require(path).tap do |loaded| | |
if loaded | |
sleep 1 | |
puts "Loaded #{path}" | |
end | |
end | |
end | |
end | |
threads = Array.new(10) do | |
Thread.new { Date } | |
end | |
threads.each(&:join) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment