Finding current Thread Id with JRuby on Rails -
i using rails3 puma on jruby 1.7 threaded mode ( config.threadsafe!
) enabled.
now theory goes: multiple client requests come in, new thread used serve user rather new rails process being started every time.
if want find id of new request thread, how can so?
for purpose, find following methods useful:
thread.current
gets of thread being executed
#<thread:0x8301ef4 run>
thread.list
array of thread objects threads either runnable or stopped.
[ [0] #<thread:0x8301ef4 run> ]
hope helps
Comments
Post a Comment