[External] : Re: Synchronous executor interface

Attila Kelemen attila.kelemen85 at gmail.com
Fri Aug 11 22:46:09 UTC 2023


>
>
> Please do not write code like that. If you have a “service” put it behind
> an api/facade and do any concurrency controls there - make it a simple
> method call for the caller/user.
>
> Systems designed the way you propose are really hard to reason about
> except for the original designer.  Similar to DI and micro services.
>
> The system’s intent and operation are obscured.
>

(I'm a bit confused which code you are referring to, because I didn't write
the above code)

It is a design trade-off, and depends on the actual circumstance if an
executor usage worth it or not (just like DI, and micro services, you win
some, you lose some) but that is partially off-topic since we have already
established that you don't think this is useful (it is completely pointless
to repeat our previous conversation, because we are just going in circles).

However, currently we are talking about that Ron claimed that such an
interface would be effectively equivalent to `Function<Supplier<T>, T>` or
`Function<Supplier<T>, Supplier<T>>`, which is demonstrably false in my
opinion, because you can't define the "T" at executor instantiation time
for a reasonably useful executor..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20230812/fa0ebb8c/attachment.htm>


More information about the loom-dev mailing list