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

38 views
Skip to first unread message

Andrey Grin

unread,
Jun 27, 2014, 12:10:05 PM6/27/14
to 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

Reply all
Reply to author
Forward
0 new messages