Comments (3)
I think this could be achieved using the Vert.X message bus system ... which I already plan to make easier to use with annotations ... combining those two you could achieve this.
from rest.vertx.
OK ... I have released a test version with Async execution ... should be up in about 30mins
<dependency>
<groupId>com.zandero</groupId>
<artifactId>rest.vertx</artifactId>
<version>0.8.1-RC.1</version>
</dependency>
If a REST method returns a Future than a handler waits for the future to finish ... and returns the desired response.
The writer is determined according the future.result() type ...
For instance:
@GET
@Path("async/{time}")
@ResponseWriter(GenericResponseWriter.class)
public Future<String> async(@Context Vertx vertx, @PathParam("time") int time) {
Future<String> future = Future.future();
slowService.async(vertx, future, time);
return future;
}
Please give it a spin ...
from rest.vertx.
thank you ! I will try to test it before the end of the week
from rest.vertx.
Related Issues (20)
- IllegalArgumentException when register ExceptionHandler HOT 6
- Authentication does not work as in example HOT 8
- Multipart requests support? HOT 4
- Response head already sent HOT 9
- NoContentResponseWriter does not return response HOT 1
- version 1.0.5 RouteDefinition BODY_HANDLER_PARAMS not include context HOT 1
- java 17 compatibility (TypeVariableImpl) HOT 4
- RestBuilder violates Vert.x 4.3's handler ordering HOT 3
- Is this possible to print the cause of exception? HOT 5
- Registered ValueReader not used to decode query parameters unless explicitly stated
- Improve not found handling HOT 1
- Add suspendable function support to asynchronous response types HOT 3
- Cannot use null enum value in REST endpoint url HOT 2
- Support Swagger or Open API HOT 1
- Rewrite authorization/authentication flow
- HttpMethod problem in vertx4 HOT 1
- The detailed exception is hidden when fail to getInstance HOT 2
- Could you add Interceptor in path route like spring? HOT 6
- mountSubRouter HOT 2
- About Interceptor HOT 2
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 rest.vertx.