File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -322,15 +322,15 @@ will automatically stop any running server when the verticle is un-deployed.
322322
323323=== What happened to Vert.x 4 Verticle and AbstractVerticle contracts?
324324
325- The contract defined by `Verticle` and `AbstractVerticle` was not adapted anymore to Vert.x 5 future based model
325+ The contract defined by `Verticle` and `AbstractVerticle` wasn't convenient anymore with Vert.x 5 future based model:
326326
327327[source,java]
328328----
329329{@link examples.CoreExamples#verticleContract}
330330----
331331
332- `Verticle` and `AbstractVerticle` are not deprecated in Vert.x 5 and it is fine to use them, however it is not the default
333- recommended choice anymore.
332+ Nevertheless, `Verticle` and `AbstractVerticle` are not deprecated in Vert.x 5.
333+ It is fine to use them, however it is not the default recommended choice anymore.
334334
335335=== Verticle Types
336336
Original file line number Diff line number Diff line change 1212package examples ;
1313
1414import io .netty .handler .logging .ByteBufFormat ;
15- import io .vertx .core .*;
15+ import io .vertx .core .DeploymentOptions ;
16+ import io .vertx .core .Future ;
17+ import io .vertx .core .VerticleBase ;
18+ import io .vertx .core .Vertx ;
1619import io .vertx .core .buffer .Buffer ;
1720import io .vertx .core .http .ClientAuth ;
1821import io .vertx .core .http .HttpServer ;
@@ -172,20 +175,20 @@ public void example10(NetSocket socket) {
172175
173176 public void example11 (Vertx vertx ) {
174177
175- class MyVerticle extends AbstractVerticle {
178+ class MyVerticle extends VerticleBase {
176179
177180 NetServer server ;
178181
179182 @ Override
180- public void start () throws Exception {
183+ public Future <?> start () {
181184 server = vertx .createNetServer ();
182185 server .connectHandler (socket -> {
183186 socket .handler (buffer -> {
184187 // Just echo back the data
185188 socket .write (buffer );
186189 });
187190 });
188- server .listen (1234 , "localhost" );
191+ return server .listen (1234 , "localhost" );
189192 }
190193 }
191194
You can’t perform that action at this time.
0 commit comments