This repository has been archived by the owner on Jan 26, 2021. It is now read-only.
Releases: weld/weld-vertx
Releases · weld/weld-vertx
1.2.0.Final
- Introduce async helpers AsyncReference and AsyncWorker - see also Core
- Introduce
@WebRoute
observer methods - see also Web - Tests refactorings
AsyncReference
example
@ApplicationScoped
class Hello {
@Inject
AsynReference<ServiceWithBlockingInit> service;
CompletionStage<String> hello() {
return service.thenApply(s -> "Hello" + s.getName() + "!");
}
}
AsyncWorker
example
@ApplicationScoped
public class Hello {
@Inject
AsyncWorker worker;
@Inject
Service service;
CompletionStage<String> hello() {
return worker.performBlocking(service::getMessageFromDb).thenApply(m -> "Hello " + m + "!");
}
}
@WebRoute
observer method example
@ApplicationScoped
class Hello {
@WebRoute("/hello")
void hello(@Observes RoutingContext ctx) {
ctx.response().setStatusCode(200).end("Hello!");
}
}