3 ms·
http://vertx.io/docs/ http://vertx.io/docs/ Vert.x provides the things like databases, redis, too. And no I don't use Vert.x However in Java it isn't that hard
by merb 11y ago
http://vertx.io/docs/ http://vertx.io/docs/
Vert.x provides the things like databases, redis, too. And no I don't use Vert.x
However in Java it isn't that hard anymore to make a Sync Library Async, especially JDBC. Thanks to CompletableFuture on Java8, the problem is, is that not lot's of companies are on Java8, however if you are using vert.x that shouldn't be the case.
Libraries in Java are mostly Synchronous cause people use Java4, Java5, Java6, Java7 and not Lambda's and Futures. I mean there are really libraries out there who providing Java4 support. They provided Java3 Support until the end of 2014.. Especially Libraries who are generating content are having backwards compability to the beginnings.
Edit: Oh and the Vert.x JDBC Client is a wrapper around JDBC with RxJava / Future's. Which is basically the best thing you could do.
Edit2: Oh and what I dislike more than synchronous code is code that has getters and setters, since that makes it hard to wrap a library into a thread pool since mutable data isn't a nice thing to deal with inside a async fashion. However it was traditional to have getter and setter classes . But more and more this isn't the case for newer things.
- yid 11y ago> Are you drunk? Your comment would have been upvote-worthy had you simply left this bit of snark out. How on earth do you think this is a decent thing to say to someone you do not know?
- merb 11y agoSorry you are right. Too much emotions .
- mmastrac 11y ago> However in Java it isn't that hard anymore to make a Sync Library Async Not necessarily true. Sure you can create a set of worker threads that take requests, process them synchronously, and hand stuff back but that's going to inflate your thread count and it's nowhere as optimal as writing a library that is async-aware from the first line of code. On top of that, lots of Java code assumes that you'll be making various sequenced calls from the same thread. You'll find that libraries will randomly corrupt data or return stale reads if they haven't been synchronized properly. Many protocols (ie: Redis) have built-in pipelining that isn't used in sync libraries.
- merb 11y ago> You'll find that libraries will randomly corrupt data or return stale reads if they haven't been synchronized properly Yeah that's what I meant with my second edit. it's really really aweful if libraries use a too mutual style.