#CompletableFutures

1 messages · Page 1 of 1 (latest)

bleak bough
#

Hello, can somebody give me maybe an example for how to use CompletableFutures correctly?
(without blocking the main thread)

narrow swanBOT
#

<@&987246399047479336> please have a look, thanks.

narrow swanBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

unreal solar
#

honestly, don't bother

#

well - someone will give an example i'm sure

#

but as of a few weeks from now, chances are CompletableFuture will be a far more niche tool than it is now

#

and blocking the main thread will be fine

fluid wigeon
#

does the new Java release add things for concurrency?

unreal solar
#

vthreads

fluid wigeon
# unreal solar vthreads

Heh will that make completableFutures obsolete??
Isn't vthreads for larger amounts of smaller tasks?

unreal solar
#

probably, yeah

#

not obsolete so much as more niche

#

even more so once structured concurrency lands

fluid wigeon
#

Fair, I already had issues trying to pick what concurrency method to use ;-;

eager girder
fluid wigeon
#

tell that to emccue-

#

idk

#

won't the CompletableFuture api just adapt to be able to use with vthreads

eager girder
#

Yes

bleak bough