Class Vertx
- java.lang.Object
-
- io.vertx.mutiny.core.Vertx
-
- All Implemented Interfaces:
Measured
public class Vertx extends Object implements Measured
The entry point into the Vert.x Core API.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()
andclusteredVertx(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 Modifier and Type Field Description static TypeArg<Vertx>
__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static VertxBuilder
builder()
boolean
cancelTimer(long id)
io.smallrye.mutiny.Uni<Void>
close()
Likeclose()
but the completionHandler will be called when the close is completeVoid
closeAndAwait()
Blocking variant ofclose()
.void
closeAndForget()
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.DatagramSocket
createDatagramSocket()
DatagramSocket
createDatagramSocket(io.vertx.core.datagram.DatagramSocketOptions options)
DnsClient
createDnsClient()
DnsClient
createDnsClient(int port, String host)
DnsClient
createDnsClient(io.vertx.core.dns.DnsClientOptions options)
HttpClient
createHttpClient()
HttpClient
createHttpClient(io.vertx.core.http.HttpClientOptions clientOptions)
HttpClient
createHttpClient(io.vertx.core.http.HttpClientOptions clientOptions, io.vertx.core.http.PoolOptions poolOptions)
HttpClient
createHttpClient(io.vertx.core.http.PoolOptions poolOptions)
HttpServer
createHttpServer()
HttpServer
createHttpServer(io.vertx.core.http.HttpServerOptions options)
NetClient
createNetClient()
NetClient
createNetClient(io.vertx.core.net.NetClientOptions options)
NetServer
createNetServer()
NetServer
createNetServer(io.vertx.core.net.NetServerOptions options)
WorkerExecutor
createSharedWorkerExecutor(String name)
WorkerExecutor
createSharedWorkerExecutor(String name, int poolSize)
WorkerExecutor
createSharedWorkerExecutor(String name, int poolSize, long maxExecuteTime)
WorkerExecutor
createSharedWorkerExecutor(String name, int poolSize, long maxExecuteTime, TimeUnit maxExecuteTimeUnit)
WebSocketClient
createWebSocketClient()
WebSocketClient
createWebSocketClient(io.vertx.core.http.WebSocketClientOptions options)
static Context
currentContext()
Set<String>
deploymentIDs()
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
.String
deployVerticleAndAwait(io.vertx.core.Verticle verticle)
Blocking variant ofdeployVerticle(Verticle)
.String
deployVerticleAndAwait(io.vertx.core.Verticle verticle, io.vertx.core.DeploymentOptions options)
Blocking variant ofdeployVerticle(Verticle,DeploymentOptions)
.String
deployVerticleAndAwait(String name)
Blocking variant ofdeployVerticle(String)
.String
deployVerticleAndAwait(String name, io.vertx.core.DeploymentOptions options)
Blocking variant ofdeployVerticle(String,DeploymentOptions)
.String
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
deployVerticleAndForget(String name)
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
equals(Object o)
EventBus
eventBus()
Vertx
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.instead useexecuteBlocking(Callable)
<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.FileSystem
fileSystem()
io.vertx.core.Vertx
getDelegate()
Context
getOrCreateContext()
int
hashCode()
HttpClientBuilder
httpClientBuilder()
boolean
isClustered()
boolean
isMetricsEnabled()
boolean
isNativeTransportEnabled()
io.netty.channel.EventLoopGroup
nettyEventLoopGroup()
Deprecated.removed from public API in Vert.x 5static Vertx
newInstance(io.vertx.core.Vertx arg)
TimeoutStream
periodicStream(long delay)
Deprecated.TimeoutStream
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
setTimer(long delay, Consumer<Long> handler)
SharedData
sharedData()
Timer
timer(long delay)
Timer
timer(long delay, TimeUnit unit)
TimeoutStream
timerStream(long delay)
Deprecated.String
toString()
Throwable
unavailableNativeTransportCause()
io.smallrye.mutiny.Uni<Void>
undeploy(String deploymentID)
Like#undeploy(String)
but the completionHandler will be notified when the undeployment is complete.Void
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>
verticleFactories()
static Vertx
vertx()
static Vertx
vertx(io.vertx.core.VertxOptions options)
-
-
-
Constructor Detail
-
Vertx
public Vertx(io.vertx.core.Vertx delegate)
-
Vertx
public Vertx(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.core.Vertx getDelegate()
- Specified by:
getDelegate
in interfaceMeasured
-
isMetricsEnabled
public boolean isMetricsEnabled()
- Specified by:
isMetricsEnabled
in interfaceMeasured
- Returns:
true
if metrics are enabled
-
builder
public static VertxBuilder builder()
-
vertx
public static Vertx vertx()
- Returns:
- the instance
-
vertx
public static Vertx vertx(io.vertx.core.VertxOptions options)
- 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
public static Vertx clusteredVertxAndAwait(io.vertx.core.VertxOptions options)
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
public static Context currentContext()
- Returns:
- The current context or
null
if there is no current context
-
getOrCreateContext
public Context getOrCreateContext()
- Returns:
- The current context (created if didn't exist)
-
createNetServer
public NetServer createNetServer(io.vertx.core.net.NetServerOptions options)
- Parameters:
options
- the options to use- Returns:
- the server
-
createNetServer
public NetServer createNetServer()
- Returns:
- the server
-
createNetClient
public NetClient createNetClient(io.vertx.core.net.NetClientOptions options)
- Parameters:
options
- the options to use- Returns:
- the client
-
createNetClient
public NetClient createNetClient()
- Returns:
- the client
-
createHttpServer
public HttpServer createHttpServer(io.vertx.core.http.HttpServerOptions options)
- Parameters:
options
- the options to use- Returns:
- the server
-
createHttpServer
public HttpServer createHttpServer()
- Returns:
- the server
-
createWebSocketClient
public WebSocketClient createWebSocketClient()
- Returns:
- the client
-
createWebSocketClient
public WebSocketClient createWebSocketClient(io.vertx.core.http.WebSocketClientOptions options)
- Parameters:
options
- the options to use- Returns:
- the client
-
httpClientBuilder
public HttpClientBuilder 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
public HttpClient createHttpClient(io.vertx.core.http.HttpClientOptions clientOptions)
- Parameters:
clientOptions
- the options to use- Returns:
- the client
-
createHttpClient
public HttpClient createHttpClient(io.vertx.core.http.PoolOptions poolOptions)
- Parameters:
poolOptions
- the pool options to use- Returns:
- the client
-
createHttpClient
public HttpClient createHttpClient()
- Returns:
- the client
-
createDatagramSocket
public DatagramSocket createDatagramSocket(io.vertx.core.datagram.DatagramSocketOptions options)
- Parameters:
options
- the options to use- Returns:
- the socket
-
createDatagramSocket
public DatagramSocket createDatagramSocket()
- Returns:
- the socket
-
fileSystem
public FileSystem fileSystem()
- Returns:
- the filesystem object
-
eventBus
public EventBus eventBus()
- Returns:
- the event bus object
-
createDnsClient
public DnsClient createDnsClient(int port, String host)
- Parameters:
port
- the porthost
- the host- Returns:
- the DNS client
-
createDnsClient
public DnsClient createDnsClient()
- Returns:
- the DNS client
-
createDnsClient
public DnsClient createDnsClient(io.vertx.core.dns.DnsClientOptions options)
- Parameters:
options
- the client options- Returns:
- the DNS client
-
sharedData
public SharedData sharedData()
- Returns:
- the shared data object
-
timer
public Timer timer(long delay)
- Parameters:
delay
-- Returns:
-
timer
public Timer timer(long delay, TimeUnit unit)
- Parameters:
delay
- the delayunit
- the delay unit- Returns:
- the timer object
-
setTimer
public long setTimer(long delay, Consumer<Long> handler)
- 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 public TimeoutStream timerStream(long delay)
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
public long setPeriodic(long delay, Consumer<Long> handler)
- 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
public long setPeriodic(long initialDelay, long delay, Consumer<Long> handler)
- 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 public TimeoutStream periodicStream(long delay)
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 public TimeoutStream periodicStream(long initialDelay, long delay)
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
public void runOnContext(Runnable action)
- Parameters:
action
- - a handler representing the action to execute
-
close
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> 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
public Void 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
@CheckReturnValue public io.smallrye.mutiny.Uni<String> deployVerticle(String name)
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
public String deployVerticleAndAwait(String name)
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
public void deployVerticleAndForget(String name)
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
public String deployVerticleAndAwait(String name, io.vertx.core.DeploymentOptions options)
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
public void deployVerticleAndForget(String name, io.vertx.core.DeploymentOptions options)
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
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> undeploy(String deploymentID)
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
public Void undeployAndAwait(String deploymentID)
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
public void undeployAndForget(String deploymentID)
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
-
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 ofio.vertx.mutiny.core.Vertx#executeBlocking(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 ofio.vertx.mutiny.core.Vertx#executeBlocking(Consumer,boolean)
that ignores the result of the operation.This method subscribes on the result of
io.vertx.mutiny.core.Vertx#executeBlocking(Consumer,boolean)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.core.Vertx#executeBlocking(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 public <T> T executeBlockingAndAwait(io.smallrye.mutiny.Uni<T> blockingCodeHandler)
Deprecated.instead useexecuteBlocking(Callable)
Blocking variant ofio.vertx.mutiny.core.Vertx#executeBlocking(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 public <T> void executeBlockingAndForget(io.smallrye.mutiny.Uni<T> blockingCodeHandler)
Deprecated.instead useexecuteBlocking(Callable)
Variant ofio.vertx.mutiny.core.Vertx#executeBlocking(Consumer)
that ignores the result of the operation.This method subscribes on the result of
io.vertx.mutiny.core.Vertx#executeBlocking(Consumer)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.core.Vertx#executeBlocking(Consumer)
but you don't need to compose it with other operations.- Parameters:
blockingCodeHandler
-
-
createSharedWorkerExecutor
public WorkerExecutor createSharedWorkerExecutor(String name)
- Parameters:
name
-- Returns:
-
createSharedWorkerExecutor
public WorkerExecutor createSharedWorkerExecutor(String name, int poolSize)
- Parameters:
name
-poolSize
-- Returns:
-
createSharedWorkerExecutor
public WorkerExecutor createSharedWorkerExecutor(String name, int poolSize, long maxExecuteTime)
- Parameters:
name
-poolSize
-maxExecuteTime
-- Returns:
-
createSharedWorkerExecutor
public WorkerExecutor createSharedWorkerExecutor(String name, int poolSize, long maxExecuteTime, TimeUnit maxExecuteTimeUnit)
- Parameters:
name
- the name of the worker executorpoolSize
- the size of the poolmaxExecuteTime
- the value of max worker execute timemaxExecuteTimeUnit
- the value of unit of max worker execute time- Returns:
- the named worker executor
-
isNativeTransportEnabled
public boolean isNativeTransportEnabled()
- Returns:
- whether the native transport is used
-
unavailableNativeTransportCause
public Throwable unavailableNativeTransportCause()
- Returns:
- the error (if any) that cause the unavailability of native transport when
isNativeTransportEnabled()
returnsfalse
.
-
exceptionHandler
public Vertx exceptionHandler(Consumer<Throwable> handler)
- 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
public String deployVerticleAndAwait(io.vertx.core.Verticle verticle)
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
public Set<io.vertx.core.spi.VerticleFactory> 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
public <T> T executeBlockingAndAwait(Callable<T> blockingCodeHandler)
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
public <T> void executeBlockingAndForget(Callable<T> blockingCodeHandler)
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
public <T> T executeBlockingAndAwait(Callable<T> blockingCodeHandler, boolean ordered)
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
public <T> void executeBlockingAndForget(Callable<T> blockingCodeHandler, boolean ordered)
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 public io.netty.channel.EventLoopGroup nettyEventLoopGroup()
Deprecated.removed from public API in Vert.x 5- Returns:
- the EventLoopGroup
-
newInstance
public static Vertx newInstance(io.vertx.core.Vertx arg)
-
-