Andrey,
If your application is using ThreadLocals to maintain state, then it's
implicitly assuming that the same thread will be calling into it. As
you've discovered, that's not the case with nREPL; each evaluation is
performed on a thread from a threadpool, which can grow and shrink as
usage and the vagaries of the threadpool implementation demand.
I'm confused about how this is any different from a servlet container
though, since they generally have roughly the same architecture as
nREPL: each incoming request is handled by a different thread.
Whatever state-management or thread coordination machinery you have in
place for that environment should work equally well when interacting
with it via the REPL.
Otherwise, you could always create a new Thread that runs a dedicated
dispatch loop, into which you could add request and from which you
could retrieve results. This would ensure that the ThreadLocal-using
code always only ever sees one thread.
- Chas
> --
> You received this message because you are subscribed to the Google
> Groups "clojure-tools" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
clojure-tool...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.