Skip to content

Instantly share code, notes, and snippets.

@jodosha
Created July 9, 2020 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jodosha/8918026603aa9dc7ba069caca453f137 to your computer and use it in GitHub Desktop.
Save jodosha/8918026603aa9dc7ba069caca453f137 to your computer and use it in GitHub Desktop.
Limits of Ruby's Thread.current
# 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