Wrapping light table eval in remote nrepl with code that sets and then clears ThreadLocal variable

38 visningar
Hoppa till det första olästa meddelandet

Andrey Grin

oläst,
27 juni 2014 12:10:052014-06-27
till light...@googlegroups.com
Hi,

I try to use LightTable with remote nrepl integrated into some existing system. I integrated LightTable middleware and everything works fine in general except for one issue: most of the time evaluated clojure code calls some existing functionality implemented in java that depends on some session specific context that is stored in ThreadLocal. I implemented own nrepl middleware that creates and stores this context in some map for each nrepl session. So basically I need some wrapper around eval call executed already in the same worker thread where eval is executed that allosw smth. like this
(do
(init-thread-local session)
(eval ...)
(clear-thread-local session))

where session is nrepl session.

Is it achievable somehow on LightTable level (or LightTable middleware) w/o modifications?

Thanks

Svara alla
Svara författaren
Vidarebefordra
0 nya meddelanden