Cancels the timer with the specified id
.
Like {@link Vertx#close} but the completionHandler will be called when the close is complete
Like {@link Vertx#close} but the completionHandler will be called when the close is complete
Create a datagram socket using the specified options
Create a datagram socket using default options
Create a DNS client to connect to a DNS server at the specified host and port, with the default query timeout (5 seconds)
Create a DNS client to connect to the DNS server configured by VertxOptions
DNS client takes the first configured resolver address provided by }
Create a DNS client to connect to a DNS server
Create a HTTP/HTTPS client using the specified options
Create a HTTP/HTTPS client using default options
Create an HTTP/HTTPS server using the specified options
Create an HTTP/HTTPS server using default options
Create a TCP/SSL client using the specified options
Create a TCP/SSL client using default options
Create a TCP/SSL server using the specified options
Create a TCP/SSL server using default options
Like {@link Vertx#createSharedWorkerExecutor} but with the VertxOptions poolSize
.
Like {@link Vertx#createSharedWorkerExecutor} but with the VertxOptions maxExecuteTime
.
Like {@link Vertx#createSharedWorkerExecutor} but with the VertxOptions maxExecuteTimeUnit
.
Create a named worker executor, the executor should be closed when it's not needed anymore to release resources.
This method can be called mutiple times with the same name
. Executors with the same name will share
the same worker pool. The worker pool size , max execute time and unit of max execute time are set when the worker pool is created and
won't change after.
The worker pool is released when all the WorkerExecutor sharing the same name are closed.
Like {@link Vertx#deployVerticle} 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.
Like {@link Vertx#deployVerticle} 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.
Like {@link Vertx#deployVerticle} but DeploymentOptions are provided to configure the deployment.
Like {@link Vertx#deployVerticle} but DeploymentOptions are provided to configure the deployment.
Like {@link Vertx#deployVerticle} 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.
Like {@link Vertx#deployVerticle} 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.
Like {@link Vertx#deployVerticle} but DeploymentOptions are provided to configure the deployment.
Like {@link Vertx#deployVerticle} but DeploymentOptions are provided to configure the deployment.
Like {@link Vertx#deployVerticle} but {@link Verticle} instance is created by
invoking the verticleSupplier
.
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.
Like {@link Vertx#deployVerticle} but {@link Verticle} instance is created by
invoking the verticleSupplier
.
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.
Return a Set of deployment IDs for the currently deployed deploymentIDs.
Get the event bus object. There is a single instance of EventBus per Vertx instance.
Safely execute some blocking code.
Executes the blocking code in the handler blockingCodeHandler
using a thread from the worker pool.
When the code is complete the handler resultHandler
will be called with the result on the original context
(e.g. on the original event loop of the caller).
A Future
instance is passed into blockingCodeHandler
. When the blocking code successfully completes,
the handler should call the {@link Promise#complete} or {@link Promise#complete} method, or the {@link Promise#fail}
method if it failed.
In the blockingCodeHandler
the current context remains the original context and therefore any task
scheduled in the blockingCodeHandler
will be executed on the 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 {@link Context#runOnContext}
Safely execute some blocking code.
Executes the blocking code in the handler blockingCodeHandler
using a thread from the worker pool.
When the code is complete the handler resultHandler
will be called with the result on the original context
(e.g. on the original event loop of the caller).
A Future
instance is passed into blockingCodeHandler
. When the blocking code successfully completes,
the handler should call the {@link Promise#complete} or {@link Promise#complete} method, or the {@link Promise#fail}
method if it failed.
In the blockingCodeHandler
the current context remains the original context and therefore any task
scheduled in the blockingCodeHandler
will be executed on the 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 {@link Context#runOnContext}
Like {@link Vertx#executeBlocking} called with ordered = true.
Like {@link Vertx#executeBlocking} called with ordered = true.
Get the filesystem object. There is a single instance of FileSystem per Vertx instance.
Gets the current context, or creates one if there isn't one
Is this Vert.x instance clustered?
Whether the metrics are enabled for this measured object
Return the Netty EventLoopGroup used by Vert.x
Returns a periodic timer as a read stream. The timer will be fired every delay
milliseconds after
the has been called.
Returns a periodic timer as a read stream. The timer will be fired every delay
milliseconds after
the has been called.
Register a VerticleFactory
that can be used for deploying Verticles based on an identifier.
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.
Set a periodic timer to fire every delay
milliseconds, at which point handler
will be called with
the id of the timer.
Set a periodic timer to fire every delay
milliseconds with initial delay, at which point handler
will be called with
the id of the timer.
Set a one-shot timer to fire after delay
milliseconds, at which point handler
will be called with
the id of the timer.
Get the shared data object. There is a single instance of SharedData per Vertx instance.
Returns a one-shot timer as a read stream. The timer will be fired after delay
milliseconds after
the has been called.
Like [#undeploy(String)] Vertx but the completionHandler will be notified when the undeployment is complete.
Like [#undeploy(String)] Vertx but the completionHandler will be notified when the undeployment is complete.
Unregister a VerticleFactory
Return the Set of currently registered verticle factories.
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.
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.
Gets the current context
Creates a non clustered instance using default options.
Creates a non clustered instance using the specified options
Generated using TypeDoc
The entry point into the Vert.x Core API.
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: {@link Vertx#vertx}, {@link Vertx#vertx} and {@link Vertx#clusteredVertx}.
Please see the user manual for more detailed usage information.