From 30189fb25127af31c0f41e9cf4dee9d7e2086925 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 15:10:36 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`feat/co?= =?UTF-8?q?derabbit`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @gunner95. * https://github.com/gunner95/vertx-rest/pull/1#issuecomment-2794156031 The following files were modified: * `src/main/java/com/dream11/rest/AbstractRestVerticle.java` --- .../dream11/rest/AbstractRestVerticle.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/java/com/dream11/rest/AbstractRestVerticle.java b/src/main/java/com/dream11/rest/AbstractRestVerticle.java index 922138c..e602a1c 100644 --- a/src/main/java/com/dream11/rest/AbstractRestVerticle.java +++ b/src/main/java/com/dream11/rest/AbstractRestVerticle.java @@ -67,6 +67,19 @@ public Completable rxStart() { return this.startHttpServer().doOnSuccess(server -> this.httpServer = server).ignoreElement(); } + /** + * Starts the HTTP server with reactive backpressure management and request routing. + * + *

+ * This method initializes the Resteasy deployment and router, creates an HTTP server using the + * configured options, and sets up a reactive request stream with backpressure handling. Requests are + * paused upon receipt; if backpressure forces a drop, the request is logged and replied to with a 503 status. + * Requests whose paths match the pattern "/swaagger(.*)" are routed through a dedicated router, + * while all other requests are processed by the Resteasy request handler. + *

+ * + * @return a Single that emits the started HTTP server instance + */ private Single startHttpServer() { VertxResteasyDeployment deployment = this.buildResteasyDeployment(); Router router = this.getRouter(); @@ -99,6 +112,15 @@ private Single startHttpServer() { .doOnSubscribe(disposable -> handleRequests.subscribe()); } + /** + * Creates and configures a Router for handling HTTP requests. + * + *

This method instantiates a new Router (without a Vert.x context) and registers default handlers: + * a BodyHandler for processing request bodies, a ResponseContentTypeHandler for setting response + * content types, and a StaticHandler for serving static files.

+ * + * @return a Router instance preconfigured with standard handlers for RESTful operations + */ protected Router getRouter() { Router router = Router.router(null); router.route().handler(BodyHandler.create());