instance method
thread_variables
Ruby on Rails 4.2.9
Since v4.0.13 Last seen in v4.2.9Signature
thread_variables()
Returns an array of the names of the thread-local variables (as Symbols).
thr = Thread.new do Thread.current.thread_variable_set(:cat, 'meow') Thread.current.thread_variable_set("dog", 'woof') end thr.join # => #<Thread:0x401b3f10 dead> thr.thread_variables # => [:dog, :cat]
Note that these are not fiber local variables. Please see Thread#thread_variable_get for more details.
Source
# File activesupport/lib/active_support/core_ext/thread.rb, line 47
def thread_variables
_locals.keys
end
Defined in activesupport/lib/active_support/core_ext/thread.rb line 47
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Thread