ScopedValue: Capturing current bindings

Attila Kelemen attila.kelemen85 at gmail.com
Sat Jun 3 18:19:35 UTC 2023


>
>
> If I allow an external framework to capture and re-use bindings later, then
> that external framework *is* able to "re-bind context objects that I define
> without going through APIs that I control."
>
>
It depends on what you mean by "re-bind context objects". I don't consider
running a task in a different context as rebinding. It is just that,
running a task in a different context, the API controls are not broken.

Also - as I have proven -  this is already possible with what we have in
Java 20, the only problem at this point is that currently it is inefficient
(and more error prone compared to if the JDK provided it). That is, you are
already allowing it, so the JDK is not protecting anything by not providing
this kind of SV capturing with an efficient method.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20230603/080e17f3/attachment.htm>


More information about the loom-dev mailing list