Future based Verticle deployment contract #5318
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Vert.x 4 has introduced a future based programming model, yet the
Verticle
andAbstractVerticle
contracts doe not leverage this model for writing deployments. In addition the current API only provides anonymous classes preventing use cases where a simple lambda would fit.Changes
Introduce a new
io.vertx.core.Deployable
interface:New deploy methods are added to
Vertx
providingIn addition
Verticle
extends nowDeployable
and Vertx only needs to handle deployments ofDeployable
.A new
VerticleBase
class can be used as a replacement ofAbstractVerticle
:Users migrating to
VerticleBase
need to change the the base class of their verticle and return aFuture<?>
instead of completing a promise or returning void (they can returnsuper.start()
).Verticle
andAbstractVerticle
are not deprecated but we do not encourage anymore to use these contracts.The
VerticleFactory
contract has been updated to provide the ability to deploy vanilla deployable.