Skip to content

Instantly share code, notes, and snippets.

@ylansegal
Created Mar 18, 2015
Embed
What would you like to do?
Use Thread.current
>> Thread.current[:your_variable] = 3
=> 3
>> puts Thread.current[:your_variable].to_i + 1
4
=> nil
>> Thread.new { puts Thread.current[:your_variable].to_i + 1 }.join
1
=> #<Thread:0x007fa68d94d870@(irb):18 dead>
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment