Replies: 3 comments 4 replies
-
As imperfect as CompletableFuture may be, I much prefer it to creating a type such as "SimplifiedFuture." CompletableFuture, for all its flaws, is the library standard for future objects. It is interoperable and flexible: feature-complete but certainly not elementary. I'm well-acquainted with CompletableFuture's failings. However, plugin developers need to learn to use CompletableFuture as it is. The Paper, Sponge, and Velocity APIs make use of CompletableFuture, and likewise many plugin APIs. We should rely on CompletableFuture for Treasury -- or perhaps CompletionStage, if the interface is to be preferred. Calling |
Beta Was this translation helpful? Give feedback.
-
Also, I think we should be considering the implications of our choice here on API return values and error handling. What I mean is that With CompletableFuture, however, it is easy to miss handling an So, if we decide to switch to CompletableFuture, we should be thinking of how to indicate transaction failures. I'm inclined to believe using exceptions will make API users omit proper failure handling, and that we should switch to returning a result wrapper. |
Beta Was this translation helpful? Give feedback.
-
We have decided to use CompletableFutures. For the (account and currency) migration system, we will be also using @MrIvanPlays's Process library. Thanks so much for your input @A248! |
Beta Was this translation helpful? Give feedback.
-
As we're working on v2, we have the liberty to do anything we want to the code.
Particularly, which concurrency system(s) we wish to use should be agreed upon.
Here are some of our choices:
Tagging those who may be interested (all Treasury contributors) - let me know if you wish to opt-out of these: @MrIvanPlays @Jikoo @MrNemo64 @creatorfromhell @A248 @yannicklamprecht @portlek @Sliman4 @NoahvdAa @Geolykt
Beta Was this translation helpful? Give feedback.
All reactions