Comments (3)
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.
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.
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)
- Dependency Dashboard
- Add CheckReturnValue annotation
- Implement simple Object mapper
- Context Sensitive SqlUpdateBuilder
- Add consumer for hikari config to data source creator
- Replace VersionInfo with SqlVersion HOT 3
- Add support for java date time api
- Replace Runtime exteptions with proper implementation
- Saidu idi talle Computer Cyber Security Information security Computer security Student at NITDA Blockchain technology HOT 2
- Trying this code to see how it will change HOT 2
- NullPointerError HOT 1
- Implement pre and post update hooks
- Switch to GNU LGPLv3 license
- Implement unit tests with embedded databases HOT 1
- SQL Updater cannot execute function creations HOT 4
- Special Characters break url encoding in database creator
- Add module info for existing modules
- Implement custom jackson dataformat for rows
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sadu.