<div dir="ltr"><div dir="ltr">robert engels <<a href="mailto:rengels@ix.netcom.com">rengels@ix.netcom.com</a>> ezt írta (időpont: 2023. aug. 8., K, 1:52):<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">But why not? Future is pervasive - and then the user can easily switch between synchronous executors and async executors with no user code change - and 0 changes to the JDK.<div><div><div><br></div></div></div></div></blockquote><div><br></div><div>Because Future does not convey the idea that it must be synchronous (in fact, it hints otherwise), and doing something like this is dangerous for async executors, because it is often hard to argue about the context you are called in:</div><div><br></div><div>```</div><div>// ExecutorService executor</div><div>var result = executor</div><div>  .submit(() -> whatever_action)</div><div>  .get();</div><div>```</div></div></div>