Giter VIP home page Giter VIP logo

Comments (3)

rainbowdashlabs avatar rainbowdashlabs commented on August 17, 2024 1

Yeah in that case you should use those.
Implementing threading wasnt really feasible with the new way queries are defined, thats why I threw away that part to make the general usability better over all.

I personally use my own threading utils for minecraft, which allow easy backsyncing onto the main thread if required.
Its based on some stuff from lucko and proved to be quite usable.
https://github.com/eldoriarpg/eldo-util/blob/main/threading/src/main/java/de/eldoria/eldoutilities/threading/futures/CompletableBukkitFuture.java
https://github.com/eldoriarpg/eldo-util/blob/main/threading/src/main/java/de/eldoria/eldoutilities/threading/futures/BukkitFutureResult.java

from sadu.

rainbowdashlabs avatar rainbowdashlabs commented on August 17, 2024

There is also a migration guide. Not sure whether you found it already c:
https://sadu.docs.chojo.dev/queries/migration/

Handling threading wasnt really the scope of sadu to begin with. usually it clutters the code and makes it more complex than required.

Especially with Virtual Threads being a stable feature now in java threading became even more irrelevant. In web applications a request is now handled on a virtual thread which allows you to do everything in a blocking fashion anyway.
The generally preferred way now is to just use virtual threads when you have some kind of web service and just do everything blocking.

I dont know your exact use case tho, so if you require asynchronous code for some other reason just wrap the call to the database into a single CompletableFuture#supplyAsync and call it a day. Thats what sadu did as well previously.

I hope this helps you.

from sadu.

BadPackage avatar BadPackage commented on August 17, 2024

Ahh, thank you for your help. I'm using it in my Minecraft Plugin, and I find CompletableFutures very beneficial.

from sadu.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.