Class Vertx
- All Implemented Interfaces:
MutinyDelegate
,Measured
You use an instance of this class for functionality including:
- Creating TCP clients and servers
- Creating HTTP clients and servers
- Creating DNS clients
- Creating Datagram sockets
- Setting and cancelling periodic and one-shot timers
- Getting a reference to the event bus API
- Getting a reference to the file system API
- Getting a reference to the shared data API
- Deploying and undeploying verticles
Most functionality in Vert.x core is fairly low level.
To create an instance of this class you can use the static factory methods: vertx()
,
vertx()
and clusteredVertx(io.vertx.core.VertxOptions)
.
Please see the user manual for more detailed usage information.
NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VertxBuilder
builder()
boolean
cancelTimer
(long id) io.smallrye.mutiny.Uni<Void>
close()
Likeclose()
but the completionHandler will be called when the close is completeBlocking variant ofclose()
.void
Variant ofclose()
that ignores the result of the operation.static io.smallrye.mutiny.Uni<Vertx>
clusteredVertx
(io.vertx.core.VertxOptions options) Creates a clustered instance using the specified options.static Vertx
clusteredVertxAndAwait
(io.vertx.core.VertxOptions options) Blocking variant ofclusteredVertx(VertxOptions)
.static void
clusteredVertxAndForget
(io.vertx.core.VertxOptions options) Variant ofclusteredVertx(VertxOptions)
that ignores the result of the operation.createDatagramSocket
(io.vertx.core.datagram.DatagramSocketOptions options) createDnsClient
(int port, String host) createDnsClient
(io.vertx.core.dns.DnsClientOptions options) createHttpClient
(io.vertx.core.http.HttpClientOptions clientOptions) createHttpClient
(io.vertx.core.http.HttpClientOptions clientOptions, io.vertx.core.http.PoolOptions poolOptions) createHttpClient
(io.vertx.core.http.PoolOptions poolOptions) createHttpServer
(io.vertx.core.http.HttpServerOptions options) createNetClient
(io.vertx.core.net.NetClientOptions options) createNetServer
(io.vertx.core.net.NetServerOptions options) createSharedWorkerExecutor
(String name, int poolSize) createSharedWorkerExecutor
(String name, int poolSize, long maxExecuteTime) createSharedWorkerExecutor
(String name, int poolSize, long maxExecuteTime, TimeUnit maxExecuteTimeUnit) createWebSocketClient
(io.vertx.core.http.WebSocketClientOptions options) static Context
io.smallrye.mutiny.Uni<String>
deployVerticle
(io.vertx.core.Verticle verticle) LikedeployVerticle(java.lang.String)
but the completionHandler will be notified when the deployment is complete.io.smallrye.mutiny.Uni<String>
deployVerticle
(io.vertx.core.Verticle verticle, io.vertx.core.DeploymentOptions options) LikedeployVerticle(java.lang.String)
butDeploymentOptions
are provided to configure the deployment.io.smallrye.mutiny.Uni<String>
deployVerticle
(String name) LikedeployVerticle(java.lang.String)
but the completionHandler will be notified when the deployment is complete.io.smallrye.mutiny.Uni<String>
deployVerticle
(String name, io.vertx.core.DeploymentOptions options) LikedeployVerticle(java.lang.String)
butDeploymentOptions
are provided to configure the deployment.io.smallrye.mutiny.Uni<String>
deployVerticle
(Supplier<io.vertx.core.Verticle> verticleSupplier, io.vertx.core.DeploymentOptions options) LikedeployVerticle(java.lang.String)
butVerticle
instance is created by invoking theverticleSupplier
.deployVerticleAndAwait
(io.vertx.core.Verticle verticle) Blocking variant ofdeployVerticle(Verticle)
.deployVerticleAndAwait
(io.vertx.core.Verticle verticle, io.vertx.core.DeploymentOptions options) Blocking variant ofdeployVerticle(Verticle,DeploymentOptions)
.deployVerticleAndAwait
(String name) Blocking variant ofdeployVerticle(String)
.deployVerticleAndAwait
(String name, io.vertx.core.DeploymentOptions options) Blocking variant ofdeployVerticle(String,DeploymentOptions)
.deployVerticleAndAwait
(Supplier<io.vertx.core.Verticle> verticleSupplier, io.vertx.core.DeploymentOptions options) Blocking variant ofdeployVerticle(Supplier,DeploymentOptions)
.void
deployVerticleAndForget
(io.vertx.core.Verticle verticle) Variant ofdeployVerticle(Verticle)
that ignores the result of the operation.void
deployVerticleAndForget
(io.vertx.core.Verticle verticle, io.vertx.core.DeploymentOptions options) Variant ofdeployVerticle(Verticle,DeploymentOptions)
that ignores the result of the operation.void
Variant ofdeployVerticle(String)
that ignores the result of the operation.void
deployVerticleAndForget
(String name, io.vertx.core.DeploymentOptions options) Variant ofdeployVerticle(String,DeploymentOptions)
that ignores the result of the operation.void
deployVerticleAndForget
(Supplier<io.vertx.core.Verticle> verticleSupplier, io.vertx.core.DeploymentOptions options) Variant ofdeployVerticle(Supplier,DeploymentOptions)
that ignores the result of the operation.boolean
eventBus()
exceptionHandler
(Consumer<Throwable> handler) <T> io.smallrye.mutiny.Uni<T>
executeBlocking
(io.smallrye.mutiny.Uni<T> blockingCodeHandler) LikeexecuteBlocking(io.smallrye.mutiny.Uni<T>, boolean)
called with ordered = true.<T> io.smallrye.mutiny.Uni<T>
executeBlocking
(io.smallrye.mutiny.Uni<T> blockingCodeHandler, boolean ordered) Safely execute some blocking code.<T> io.smallrye.mutiny.Uni<T>
executeBlocking
(Callable<T> blockingCodeHandler) LikeexecuteBlocking(io.smallrye.mutiny.Uni<T>, boolean)
but using a callback.<T> io.smallrye.mutiny.Uni<T>
executeBlocking
(Callable<T> blockingCodeHandler, boolean ordered) LikeexecuteBlocking(io.smallrye.mutiny.Uni<T>, boolean)
but using a callback.<T> T
executeBlockingAndAwait
(io.smallrye.mutiny.Uni<T> blockingCodeHandler) Deprecated.<T> T
executeBlockingAndAwait
(io.smallrye.mutiny.Uni<T> blockingCodeHandler, boolean ordered) Deprecated.use insteadexecuteBlocking(Callable, boolean)
<T> T
executeBlockingAndAwait
(Callable<T> blockingCodeHandler) Blocking variant ofexecuteBlocking(Callable)
.<T> T
executeBlockingAndAwait
(Callable<T> blockingCodeHandler, boolean ordered) Blocking variant ofexecuteBlocking(Callable,boolean)
.<T> void
executeBlockingAndForget
(io.smallrye.mutiny.Uni<T> blockingCodeHandler) Deprecated.instead useexecuteBlocking(Callable)
<T> void
executeBlockingAndForget
(io.smallrye.mutiny.Uni<T> blockingCodeHandler, boolean ordered) Deprecated.use insteadexecuteBlocking(Callable, boolean)
<T> void
executeBlockingAndForget
(Callable<T> blockingCodeHandler) Variant ofexecuteBlocking(Callable)
that ignores the result of the operation.<T> void
executeBlockingAndForget
(Callable<T> blockingCodeHandler, boolean ordered) Variant ofexecuteBlocking(Callable,boolean)
that ignores the result of the operation.io.vertx.core.Vertx
int
hashCode()
boolean
boolean
boolean
io.netty.channel.EventLoopGroup
Deprecated.removed from public API in Vert.x 5static Vertx
newInstance
(io.vertx.core.Vertx arg) periodicStream
(long delay) Deprecated.periodicStream
(long initialDelay, long delay) Deprecated.void
registerVerticleFactory
(io.vertx.core.spi.VerticleFactory factory) void
runOnContext
(Runnable action) long
setPeriodic
(long initialDelay, long delay, Consumer<Long> handler) long
setPeriodic
(long delay, Consumer<Long> handler) long
timer
(long delay) timerStream
(long delay) Deprecated.toString()
io.smallrye.mutiny.Uni<Void>
Like#undeploy(String)
but the completionHandler will be notified when the undeployment is complete.undeployAndAwait
(String deploymentID) Blocking variant ofundeploy(String)
.void
undeployAndForget
(String deploymentID) Variant ofundeploy(String)
that ignores the result of the operation.void
unregisterVerticleFactory
(io.vertx.core.spi.VerticleFactory factory) Set<io.vertx.core.spi.VerticleFactory>
static Vertx
vertx()
static Vertx
vertx
(io.vertx.core.VertxOptions options)
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
Vertx
public Vertx(io.vertx.core.Vertx delegate) -
Vertx
-
-
Method Details
-
getDelegate
public io.vertx.core.Vertx getDelegate()- Specified by:
getDelegate
in interfaceMeasured
- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
isMetricsEnabled
public boolean isMetricsEnabled()- Specified by:
isMetricsEnabled
in interfaceMeasured
- Returns:
true
if metrics are enabled
-
builder
-
vertx
- Returns:
- the instance
-
vertx
- Parameters:
options
- the options to use- Returns:
- the instance
-
clusteredVertx
@CheckReturnValue public static io.smallrye.mutiny.Uni<Vertx> clusteredVertx(io.vertx.core.VertxOptions options) Creates a clustered instance using the specified options.The instance is created asynchronously and the resultHandler is called with the result when it is ready.
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
options
- the options to use- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
clusteredVertxAndAwait
Blocking variant ofclusteredVertx(VertxOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
options
- the options to use- Returns:
- the Vertx instance produced by the operation.
-
clusteredVertxAndForget
public static void clusteredVertxAndForget(io.vertx.core.VertxOptions options) Variant ofclusteredVertx(VertxOptions)
that ignores the result of the operation.This method subscribes on the result of
clusteredVertx(VertxOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromclusteredVertx(VertxOptions)
but you don't need to compose it with other operations.- Parameters:
options
- the options to use
-
currentContext
- Returns:
- The current context or
null
if there is no current context
-
getOrCreateContext
- Returns:
- The current context (created if didn't exist)
-
createNetServer
- Parameters:
options
- the options to use- Returns:
- the server
-
createNetServer
- Returns:
- the server
-
createNetClient
- Parameters:
options
- the options to use- Returns:
- the client
-
createNetClient
- Returns:
- the client
-
createHttpServer
- Parameters:
options
- the options to use- Returns:
- the server
-
createHttpServer
- Returns:
- the server
-
createWebSocketClient
- Returns:
- the client
-
createWebSocketClient
- Parameters:
options
- the options to use- Returns:
- the client
-
httpClientBuilder
- Returns:
-
createHttpClient
public HttpClient createHttpClient(io.vertx.core.http.HttpClientOptions clientOptions, io.vertx.core.http.PoolOptions poolOptions) - Parameters:
clientOptions
- the client options to usepoolOptions
- the pool options to use- Returns:
- the client
-
createHttpClient
- Parameters:
clientOptions
- the options to use- Returns:
- the client
-
createHttpClient
- Parameters:
poolOptions
- the pool options to use- Returns:
- the client
-
createHttpClient
- Returns:
- the client
-
createDatagramSocket
- Parameters:
options
- the options to use- Returns:
- the socket
-
createDatagramSocket
- Returns:
- the socket
-
fileSystem
- Returns:
- the filesystem object
-
eventBus
- Returns:
- the event bus object
-
createDnsClient
- Parameters:
port
- the porthost
- the host- Returns:
- the DNS client
-
createDnsClient
- Returns:
- the DNS client
-
createDnsClient
- Parameters:
options
- the client options- Returns:
- the DNS client
-
timer
- Parameters:
delay
-- Returns:
-
timer
- Parameters:
delay
- the delayunit
- the delay unit- Returns:
- the timer object
-
setTimer
- Parameters:
delay
- the delay in milliseconds, after which the timer will firehandler
- the handler that will be called with the timer ID when the timer fires- Returns:
-
timerStream
Deprecated.usesetTimer(long, java.util.function.Consumer<java.lang.Long>)
instead. RxJava like integrations should use the Vert.x scheduler integration.- Parameters:
delay
- the delay in milliseconds, after which the timer will fire- Returns:
- the timer stream
-
setPeriodic
- Parameters:
delay
- the delay in milliseconds, after which the timer will firehandler
- the handler that will be called with the timer ID when the timer fires- Returns:
-
setPeriodic
- Parameters:
initialDelay
- the initial delay in millisecondsdelay
- the delay in milliseconds, after which the timer will firehandler
- the handler that will be called with the timer ID when the timer fires- Returns:
-
periodicStream
Deprecated.usesetPeriodic(long, java.util.function.Consumer<java.lang.Long>)
instead. RxJava like integrations should use the Vert.x scheduler integration.- Parameters:
delay
- the delay in milliseconds, after which the timer will fire- Returns:
- the periodic stream
-
periodicStream
Deprecated.usesetPeriodic(long, java.util.function.Consumer<java.lang.Long>)
instead. RxJava like integrations should use the Vert.x scheduler integration.- Parameters:
initialDelay
- the initial delay in millisecondsdelay
- the delay in milliseconds, after which the timer will fire- Returns:
- the periodic stream
-
cancelTimer
public boolean cancelTimer(long id) - Parameters:
id
- The id of the timer to cancel- Returns:
- true if the timer was successfully cancelled, or false if the timer does not exist.
-
runOnContext
- Parameters:
action
- - a handler representing the action to execute
-
close
Likeclose()
but the completionHandler will be called when the close is completeUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
Blocking variant ofclose()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
closeAndForget
public void closeAndForget() -
deployVerticle
LikedeployVerticle(java.lang.String)
but the completionHandler will be notified when the deployment is complete.If the deployment is successful the result will contain a String representing the unique deployment ID of the deployment.
This deployment ID can subsequently be used to undeploy the verticle.
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
name
- The identifier- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
deployVerticleAndAwait
Blocking variant ofdeployVerticle(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
name
- The identifier- Returns:
- the String instance produced by the operation.
-
deployVerticleAndForget
Variant ofdeployVerticle(String)
that ignores the result of the operation.This method subscribes on the result of
deployVerticle(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdeployVerticle(String)
but you don't need to compose it with other operations.- Parameters:
name
- The identifier
-
deployVerticle
@CheckReturnValue public io.smallrye.mutiny.Uni<String> deployVerticle(String name, io.vertx.core.DeploymentOptions options) LikedeployVerticle(java.lang.String)
butDeploymentOptions
are provided to configure the deployment.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
name
- the nameoptions
- the deployment options.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
deployVerticleAndAwait
Blocking variant ofdeployVerticle(String,DeploymentOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
name
- the nameoptions
- the deployment options.- Returns:
- the String instance produced by the operation.
-
deployVerticleAndForget
Variant ofdeployVerticle(String,DeploymentOptions)
that ignores the result of the operation.This method subscribes on the result of
deployVerticle(String,DeploymentOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdeployVerticle(String,DeploymentOptions)
but you don't need to compose it with other operations.- Parameters:
name
- the nameoptions
- the deployment options.
-
undeploy
Like#undeploy(String)
but the completionHandler will be notified when the undeployment is complete.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
deploymentID
- the deployment ID- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
undeployAndAwait
Blocking variant ofundeploy(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
deploymentID
- the deployment ID- Returns:
- the Void instance produced by the operation.
-
undeployAndForget
Variant ofundeploy(String)
that ignores the result of the operation.This method subscribes on the result of
undeploy(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromundeploy(String)
but you don't need to compose it with other operations.- Parameters:
deploymentID
- the deployment ID
-
deploymentIDs
- Returns:
- Set of deployment IDs
-
isClustered
public boolean isClustered()- Returns:
- true if clustered
-
executeBlocking
@CheckReturnValue public <T> io.smallrye.mutiny.Uni<T> executeBlocking(io.smallrye.mutiny.Uni<T> blockingCodeHandler, boolean ordered) Safely execute some blocking code.Executes the blocking code in the handler
blockingCodeHandler
using a thread from the worker pool.The returned future will be completed with the result on the original context (i.e. on the original event loop of the caller) or failed when the handler throws an exception.
A
Future
instance is passed intoblockingCodeHandler
. When the blocking code successfully completes, the handler should call thePromise.complete(T)
orPromise.complete(T)
method, or thePromise.fail(java.lang.Throwable)
method if it failed.In the
blockingCodeHandler
the current context remains the original context and therefore any task scheduled in theblockingCodeHandler
will be executed on this context and not on the worker thread.The blocking code should block for a reasonable amount of time (i.e no more than a few seconds). Long blocking operations or polling operations (i.e a thread that spin in a loop polling events in a blocking fashion) are precluded.
When the blocking operation lasts more than the 10 seconds, a message will be printed on the console by the blocked thread checker.
Long blocking operations should use a dedicated thread managed by the application, which can interact with verticles using the event-bus or
Context.runOnContext(java.lang.Runnable)
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
blockingCodeHandler
- handler representing the blocking code to runordered
- if true then if executeBlocking is called several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
executeBlockingAndAwait
@Deprecated public <T> T executeBlockingAndAwait(io.smallrye.mutiny.Uni<T> blockingCodeHandler, boolean ordered) Deprecated.use insteadexecuteBlocking(Callable, boolean)
Blocking variant ofexecuteBlocking(Consumer,boolean)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
blockingCodeHandler
- handler representing the blocking code to runordered
- if true then if executeBlocking is called several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees- Returns:
- the T instance produced by the operation.
-
executeBlockingAndForget
@Deprecated public <T> void executeBlockingAndForget(io.smallrye.mutiny.Uni<T> blockingCodeHandler, boolean ordered) Deprecated.use insteadexecuteBlocking(Callable, boolean)
Variant ofexecuteBlocking(Consumer,boolean)
that ignores the result of the operation.This method subscribes on the result of
executeBlocking(Consumer,boolean)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromexecuteBlocking(Consumer,boolean)
but you don't need to compose it with other operations.- Parameters:
blockingCodeHandler
- handler representing the blocking code to runordered
- if true then if executeBlocking is called several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees
-
executeBlocking
@CheckReturnValue public <T> io.smallrye.mutiny.Uni<T> executeBlocking(io.smallrye.mutiny.Uni<T> blockingCodeHandler) LikeexecuteBlocking(io.smallrye.mutiny.Uni<T>, boolean)
called with ordered = true.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
blockingCodeHandler
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
executeBlockingAndAwait
Deprecated.instead useexecuteBlocking(Callable)
Blocking variant ofexecuteBlocking(Consumer)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
blockingCodeHandler
-- Returns:
- the T instance produced by the operation.
-
executeBlockingAndForget
Deprecated.instead useexecuteBlocking(Callable)
Variant ofexecuteBlocking(Consumer)
that ignores the result of the operation.This method subscribes on the result of
executeBlocking(Consumer)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromexecuteBlocking(Consumer)
but you don't need to compose it with other operations.- Parameters:
blockingCodeHandler
-
-
isNativeTransportEnabled
public boolean isNativeTransportEnabled()- Returns:
- whether the native transport is used
-
exceptionHandler
- Parameters:
handler
- the exception handler- Returns:
-
deployVerticle
@CheckReturnValue public io.smallrye.mutiny.Uni<String> deployVerticle(io.vertx.core.Verticle verticle) LikedeployVerticle(java.lang.String)
but the completionHandler will be notified when the deployment is complete.If the deployment is successful the result will contain a string representing the unique deployment ID of the deployment.
This deployment ID can subsequently be used to undeploy the verticle.
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
verticle
- the verticle instance to deploy- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
deployVerticleAndAwait
Blocking variant ofdeployVerticle(Verticle)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
verticle
- the verticle instance to deploy- Returns:
- the String instance produced by the operation.
-
deployVerticleAndForget
public void deployVerticleAndForget(io.vertx.core.Verticle verticle) Variant ofdeployVerticle(Verticle)
that ignores the result of the operation.This method subscribes on the result of
deployVerticle(Verticle)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdeployVerticle(Verticle)
but you don't need to compose it with other operations.- Parameters:
verticle
- the verticle instance to deploy
-
deployVerticle
@CheckReturnValue public io.smallrye.mutiny.Uni<String> deployVerticle(io.vertx.core.Verticle verticle, io.vertx.core.DeploymentOptions options) LikedeployVerticle(java.lang.String)
butDeploymentOptions
are provided to configure the deployment.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
verticle
- the verticle instance to deployoptions
- the deployment options.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
deployVerticleAndAwait
public String deployVerticleAndAwait(io.vertx.core.Verticle verticle, io.vertx.core.DeploymentOptions options) Blocking variant ofdeployVerticle(Verticle,DeploymentOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
verticle
- the verticle instance to deployoptions
- the deployment options.- Returns:
- the String instance produced by the operation.
-
deployVerticleAndForget
public void deployVerticleAndForget(io.vertx.core.Verticle verticle, io.vertx.core.DeploymentOptions options) Variant ofdeployVerticle(Verticle,DeploymentOptions)
that ignores the result of the operation.This method subscribes on the result of
deployVerticle(Verticle,DeploymentOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdeployVerticle(Verticle,DeploymentOptions)
but you don't need to compose it with other operations.- Parameters:
verticle
- the verticle instance to deployoptions
- the deployment options.
-
deployVerticle
@CheckReturnValue public io.smallrye.mutiny.Uni<String> deployVerticle(Supplier<io.vertx.core.Verticle> verticleSupplier, io.vertx.core.DeploymentOptions options) LikedeployVerticle(java.lang.String)
butVerticle
instance is created by invoking theverticleSupplier
.The supplier will be invoked as many times as
DeploymentOptions
. It must not return the same instance twice.Note that the supplier will be invoked on the caller thread.
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
verticleSupplier
-options
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
deployVerticleAndAwait
public String deployVerticleAndAwait(Supplier<io.vertx.core.Verticle> verticleSupplier, io.vertx.core.DeploymentOptions options) Blocking variant ofdeployVerticle(Supplier,DeploymentOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
verticleSupplier
-options
-- Returns:
- the String instance produced by the operation.
-
deployVerticleAndForget
public void deployVerticleAndForget(Supplier<io.vertx.core.Verticle> verticleSupplier, io.vertx.core.DeploymentOptions options) Variant ofdeployVerticle(Supplier,DeploymentOptions)
that ignores the result of the operation.This method subscribes on the result of
deployVerticle(Supplier,DeploymentOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdeployVerticle(Supplier,DeploymentOptions)
but you don't need to compose it with other operations.- Parameters:
verticleSupplier
-options
-
-
registerVerticleFactory
public void registerVerticleFactory(io.vertx.core.spi.VerticleFactory factory) - Parameters:
factory
- the factory to register
-
unregisterVerticleFactory
public void unregisterVerticleFactory(io.vertx.core.spi.VerticleFactory factory) - Parameters:
factory
- the factory to unregister
-
verticleFactories
- Returns:
- the set of verticle factories
-
executeBlocking
@CheckReturnValue public <T> io.smallrye.mutiny.Uni<T> executeBlocking(Callable<T> blockingCodeHandler) LikeexecuteBlocking(io.smallrye.mutiny.Uni<T>, boolean)
but using a callback.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
blockingCodeHandler
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
executeBlockingAndAwait
Blocking variant ofexecuteBlocking(Callable)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
blockingCodeHandler
-- Returns:
- the T instance produced by the operation.
-
executeBlockingAndForget
Variant ofexecuteBlocking(Callable)
that ignores the result of the operation.This method subscribes on the result of
executeBlocking(Callable)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromexecuteBlocking(Callable)
but you don't need to compose it with other operations.- Parameters:
blockingCodeHandler
-
-
executeBlocking
@CheckReturnValue public <T> io.smallrye.mutiny.Uni<T> executeBlocking(Callable<T> blockingCodeHandler, boolean ordered) LikeexecuteBlocking(io.smallrye.mutiny.Uni<T>, boolean)
but using a callback.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
blockingCodeHandler
-ordered
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
executeBlockingAndAwait
Blocking variant ofexecuteBlocking(Callable,boolean)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
blockingCodeHandler
-ordered
-- Returns:
- the T instance produced by the operation.
-
executeBlockingAndForget
Variant ofexecuteBlocking(Callable,boolean)
that ignores the result of the operation.This method subscribes on the result of
executeBlocking(Callable,boolean)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromexecuteBlocking(Callable,boolean)
but you don't need to compose it with other operations.- Parameters:
blockingCodeHandler
-ordered
-
-
nettyEventLoopGroup
Deprecated.removed from public API in Vert.x 5- Returns:
- the EventLoopGroup
-
newInstance
-
executeBlocking(Callable)