Sorry for the late answer. This is mostly to support asynchronous injection.
On 17/12/2018 14:27, Ron Sigal wrote:
I've been looking at an old issue, RESTEASY-1709 "Same
instance injected across applications", which I thought I had solved by
injecting a javassist created proxy, but the reporter couldn't get it to
work so it's been sitting for almost a year.
Anyway, I've been trying to port the old code to master, and I see that
injection has changed to do a lot of stuff with CompletableFutures. In
particular, a series of injections into, say, a resource, becomes a
composition of CompletionStages, each one doing a single injection. I'm
trying to understand why.
One reason I can see is that, at least in the case of an asynchronous
invocation, you want to do as little as possible before returning a
CompletableFuture. That would provide better responsiveness. But I have
1. Is constructing a CompletableFuture that much faster than just
doing the injection?
2. I don't how much space a CompletableFuture takes, but we've turned
a simple loop into a collection of CompletableFutures, which would seem
to occupy more space. Isn't that counterproductive in terms of our
general mandate to create a smaller footprint for container applications?
I'm not saying that the new code is wrong. I'm just saying that I don't
understand why it's right.