Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How do you implement doThingOne?

You should read the "structured concurrency" link in the article. You have to explicitly wrap the call to doThingOne in a future under a structured concurrency scope. The code example you wrote is not going to be possible in Java without implementing doThingOne in a complicated way.



You don't have to use structured concurrency. The two methods use a virtual thread executor and return the result of submitting work. Structured concurrency is great but not necessary.

https://www.reactivesystems.eu/2022/06/17/introduction-to-pr...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: