You use an instance of this class for functionality including:
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(io. and clusteredVertx(io..
Please see the user manual for more detailed usage information.
| Modifier and Type | Method and Description |
|---|---|
| public static VertxBuilder | |
| public boolean | Returns: true if the timer was successfully cancelled, or false if the timer does not exist.The id of the timer to cancel id)Cancels the timer with the specified |
| public Future | Returns: a future completed with the resultStop the Vertx instance and release any resources held by it. |
| public void | close(Handler<AsyncResult<Void>>
The handler will be notified when the close is complete. completionHandler)Like |
| public static void | clusteredVertx(VertxOptions
the options to use options, Handler<AsyncResult<Vertx>> the result handler that will receive the result resultHandler)Creates a clustered instance using the specified options. |
| public static Future | clusteredVertx(VertxOptions options)
Same as |
| public DatagramSocket | Returns: the socketthe options to use options)Create a datagram socket using the specified options |
| public default DatagramSocket | |
| public DnsClient | Returns: the DNS clientthe port port, String the host host)Create a DNS client to connect to a DNS server at the specified host and port, with the default query timeout (5 seconds)
|
| public DnsClient | Returns: the DNS clientCreate a DNS client to connect to the DNS server configured by
DNS client takes the first configured resolver address provided by |
| public DnsClient | Returns: the DNS clientthe client options options)Create a DNS client to connect to a DNS server |
| public default HttpClient | Returns: the clientthe client options to use clientOptions, PoolOptions the pool options to use poolOptions)Create a HTTP/HTTPS client using the specified client and pool options |
| public default HttpClient | Returns: the clientthe options to use clientOptions)Create a HTTP/HTTPS client using the specified client options |
| public default HttpClient | Returns: the clientthe pool options to use poolOptions)Create a HTTP/HTTPS client using the specified pool options |
| public default HttpClient | |
| public HttpServer | Returns: the serverthe options to use options)Create an HTTP/HTTPS server using the specified options |
| public default HttpServer | |
| public NetClient | Returns: the clientthe options to use options)Create a TCP/SSL client using the specified options |
| public default NetClient | |
| public NetServer | Returns: the serverthe options to use options)Create a TCP/SSL server using the specified options |
| public default NetServer | |
| public WorkerExecutor | createSharedWorkerExecutor(String name)
Like |
| public WorkerExecutor | createSharedWorkerExecutor(String name, int poolSize)
Like |
| public WorkerExecutor | createSharedWorkerExecutor(String name, int poolSize, long maxExecuteTime)
Like |
| public WorkerExecutor | Returns: the named worker executorthe name of the worker executor name, int the size of the pool poolSize, long the value of max worker execute time maxExecuteTime, TimeUnit the value of unit of max worker execute time maxExecuteTimeUnit)Create a named worker executor, the executor should be closed when it's not needed anymore to release resources. |
| public default WebSocketClient | |
| public WebSocketClient | Returns: the clientthe options to use options)Create a WebSocket client using the specified options |
| public static @Nullable Context | Returns: The current context ornull if there is no current contextGets the current context |
| public Set | Returns: Set of deployment IDsReturn a Set of deployment IDs for the currently deployed deploymentIDs. |
| public default Future | Returns: a future completed with the resultthe verticle instance to deploy. verticle)Deploy a verticle instance that you have created yourself. |
| public void | deployVerticle(Verticle
the verticle instance to deploy verticle, Handler<AsyncResult<String>> a handler which will be notified when the deployment is complete completionHandler)Like |
| public Future | Returns: a future completed with the resultthe verticle instance to deploy verticle, DeploymentOptions the deployment options. options)Like |
| public Future | Returns: a future completed with the resultLike |
| public Future | Returns: a future completed with the resultLike |
| public void | deployVerticle(Verticle
the verticle instance to deploy verticle, DeploymentOptions the deployment options. options, Handler<AsyncResult<String>> a handler which will be notified when the deployment is complete completionHandler)Like |
| public void | deployVerticle(Class<? extends Verticle> verticleClass, DeploymentOptions options, Handler<AsyncResult<String>> completionHandler)
Like |
| public void | deployVerticle(Supplier<Verticle> verticleSupplier, DeploymentOptions options, Handler<AsyncResult<String>> completionHandler)
Like |
| public default Future | Returns: a future completed with the resultthe name. name)Deploy a verticle instance given a name. |
| public default void | deployVerticle(String
The identifier name, Handler<AsyncResult<String>> a handler which will be notified when the deployment is complete completionHandler)Like |
| public Future | Returns: a future completed with the resultthe name name, DeploymentOptions the deployment options. options)Like |
| public void | deployVerticle(String
the name name, DeploymentOptions the deployment options. options, Handler<AsyncResult<String>> a handler which will be notified when the deployment is complete completionHandler)Like |
| public EventBus | |
| public Vertx | Returns: a reference to this, so the API can be used fluentlythe exception handler handler)Set a default exception handler for |
| public @Nullable Handler | |
| public default < the type of the result T> void | executeBlocking(Handler<Promise<T>>
handler representing the blocking code to run blockingCodeHandler, boolean 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 ordered, Handler<AsyncResult<@Nullable T>> handler that will be called when the blocking code is complete resultHandler)
Deprecated
use instead
executeBlocking(Callable, boolean)
Safely execute some blocking code. |
| public default <T> void | executeBlocking(Handler<Promise<T>> blockingCodeHandler, Handler<AsyncResult<@Nullable T>> resultHandler)
Deprecated
instead use
executeBlocking(Callable)
Like |
| public default <T> Future | executeBlocking(Handler<Promise<T>> blockingCodeHandler, boolean ordered)
Deprecated
instead use
executeBlocking(Callable, boolean)
Same as |
| public default < the type of the result T> Future | Returns: a future completed when the blocking code is completehandler representing the blocking code to run blockingCodeHandler, boolean 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 ordered)Safely execute some blocking code. |
| public default <T> void | executeBlocking(Callable<T> blockingCodeHandler, Handler<AsyncResult<@Nullable T>> resultHandler)
Like |
| public default <T> void | executeBlocking(Callable<T> blockingCodeHandler, boolean ordered, Handler<AsyncResult<@Nullable T>> resultHandler)
Like |
| public default <T> Future | executeBlocking(Handler<Promise<T>> blockingCodeHandler)
Deprecated
instead use
executeBlocking(Callable)
Same as |
| public default <T> Future | executeBlocking(Callable<T> blockingCodeHandler)
Like |
| public FileSystem | |
| public Context | Returns: The current context (created if didn't exist)Gets the current context, or creates one if there isn't one |
| public HttpClientBuilder | httpClientBuilder()
Provide a builder for |
| public boolean | |
| public boolean | |
| public EventLoopGroup | Returns: the EventLoopGroup
Deprecated
removed from public API in Vert.x 5
Return the Netty EventLoopGroup used by Vert.x |
| public default TimeoutStream | Returns: the periodic streamthe delay in milliseconds, after which the timer will fire delay)
Deprecated
use
Vertx#setPeriodic instead. RxJava like integrations should use the Vert.x scheduler integration.
Returns a periodic timer as a read stream. |
| public TimeoutStream | Returns: the periodic streamthe initial delay in milliseconds initialDelay, long the delay in milliseconds, after which the timer will fire delay)
Deprecated
use
Vertx#setPeriodic instead. RxJava like integrations should use the Vert.x scheduler integration.
Returns a periodic timer as a read stream. |
| public void | registerVerticleFactory(VerticleFactory
the factory to register factory)Register a |
| public void | runOnContext(Handler<Void>
- a handler representing the action to execute action)Puts the handler on the event queue for the current context so it will be run asynchronously ASAP after all preceeding events have been handled. |
| public default long | Returns: the unique ID of the timerthe delay in milliseconds, after which the timer will fire delay, Handler<Long> the handler that will be called with the timer ID when the timer fires handler)Set a periodic timer to fire every |
| public long | Returns: the unique ID of the timerthe initial delay in milliseconds initialDelay, long the delay in milliseconds, after which the timer will fire delay, Handler<Long> the handler that will be called with the timer ID when the timer fires handler)Set a periodic timer to fire every |
| public long | Returns: the unique ID of the timerthe delay in milliseconds, after which the timer will fire delay, Handler<Long> the handler that will be called with the timer ID when the timer fires handler)Set a one-shot timer to fire after |
| public SharedData | |
| public default Timer | |
| public Timer | Returns: the timer objectthe delay delay, TimeUnit the delay unit unit)Create a timer task configured with the specified |
| public TimeoutStream | Returns: the timer streamthe delay in milliseconds, after which the timer will fire delay)
Deprecated
use
Vertx#setTimer instead. RxJava like integrations should use the Vert.x scheduler integration.
Returns a one-shot timer as a read stream. |
| public Throwable | Returns: the error (if any) that cause the unavailability of native transport whenisNativeTransportEnabled() returns false.
|
| public Future | |
| public void | undeploy(String
the deployment ID deploymentID, Handler<AsyncResult<Void>> a handler which will be notified when the undeployment is complete completionHandler)Like |
| public void | unregisterVerticleFactory(VerticleFactory
the factory to unregister factory)Unregister a |
| public Set | Returns: the set of verticle factoriesReturn the Set of currently registered verticle factories. |
| public static Vertx | |
| public static Vertx | Returns: the instancethe options to use options)Creates a non clustered instance using the specified options |