The problem is the “current request” from a thread other than the request thread isn't
really a meaningful thing. Say three simultaneous requests come in and the same code
runs for all three in three background threads—how would you figure out which current
request each one needs? Lift uses thread-locals so that code running in the request thread
can get to the current request without any additional plumbing, but it leans on the knowledge
that anything running in the request thread can only be referring to that request. As soon
as that guarantee ends, it becomes impossible to provide global-ish access to the “current”
request.
Hope that clarifies a little bit why it would be difficult for these to be implemented without
thread locality. If you have an idea on how we could improve that, I know I'd be interested—
it's not necessarily the most common use case, but could yield some interesting results.
Thanks,
Antonio