Created
July 9, 2020 09:04
-
-
Save jodosha/8918026603aa9dc7ba069caca453f137 to your computer and use it in GitHub Desktop.
Limits of Ruby's Thread.current
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
# frozen_string_literal: true | |
Thread.current[:request_id] = 'abc123' | |
puts "main thread: #{Thread.current[:request_id]}" | |
Thread.new do | |
puts "inner thread: #{Thread.current[:request_id]}" | |
end.join | |
__END__ | |
main thread: abc123 | |
inner thread: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment