So it sort of looks like a DSL for a variant of ThreadLocal that gives you an idea of the lifeline of variable instead of just being global. Apparently with virtual threads they are expecting an increase in the number of running (virtual) threads several orders of magnitude larger than what was previously seen and that with ThreadLocals would just be too much.<p>So the have added this:<p>> ScopedVaule.where(CONTEXT, context).run(() -> Application.handle(request, response));<p>Which stores the object referenced by `context` to the ScopedValue container `CONTEXT` ^ for the duration of the thread running `Application.handle(request,response)`.<p>Not really sexy, but I understand how you might really benefit if you are processing lots of data, but for most enterprise CRUD apps this seems inapplicable.<p>^ I think this a "monad"? I'm not a functional programmer.
Implicit parameter smuggling by any mechanism is just too much magic in my experience. Golang's context.Context solves the same problem, but explicitly in a way that has been widely adopted through their language ecosystem.<p>That said - in Java I do think it would be near impossible for the ecosystem to adopt a similar mechanic, so from a practical standpoint this may be the only way to reliably propagate context.