@evanphx @yukihiro_matz @headius I strongly agree! However the problem is legacy code which uses thread locals, e.g. ActiveRecord
@tenderlove @headius @evanphx @yukihiro_matz I guess the question is why cache the connection in a thread local?
-
-
@bascule@tenderlove@headius@yukihiro_matz Asking for the last insert id probably depends on using the same connection. -
@evanphx@tenderlove@headius@yukihiro_matz aah yes :| Is there a reasonable approach to thread affinity aside from thread locals? -
@bascule@tenderlove@headius@yukihiro_matz You could use in ivar on the Thread object (which are not what Thread#[] uses) -
@evanphx@tenderlove@headius@yukihiro_matz yeah, I've used that in Celluloid: https://github.com/celluloid/celluloid/blob/master/lib/celluloid/core_ext.rb#L5 … -
@bascule@evanphx@tenderlove@headius@yukihiro_matz what i want is: Thread.local[self] = {} when self or Thread.current die, hash does -
@raggi@bascule@evanphx@tenderlove@headius@yukihiro_matz and for 'context local' (i.e. async) you need more/different things
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.