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: @see \io\vertx\jphp\core\Vertx::vertx,
see |
and @see \io\vertx\jphp\core\Vertx::clusteredVertx. Please see the user manual for more detailed usage information. |
---|---|
package |
Default |
__construct()
cancelTimer( $arg0) : boolean
integer
boolean
true if the timer was successfully cancelled, or false if the timer does not exist.
close( $arg0 = null) : void
The instance cannot be used after it has been closed.
The actual close is asynchronous and may not complete until after the call has returned. close() Like @see \io\vertx\jphp\core\Vertx::close but the completionHandler will be called when the close is complete param $completionHandler [callable] The handler will be notified when the close is complete. close($completionHandler)
callable
clusteredVertx( $arg0, $arg1) : void
The instance is created asynchronously and the resultHandler is called with the result when it is ready.
array | VertxOptions
callable
createDatagramSocket( $arg0 = null) : \io\vertx\jphp\core\datagram\DatagramSocket
createDatagramSocket()
Create a datagram socket using the specified options
param $options [DatagramSocketOptions | array] the options to use createDatagramSocket($options)
DatagramSocketOptions | array
\io\vertx\jphp\core\datagram\DatagramSocket
the socket
createDnsClient( $arg0 = null, $arg1 = null) : \io\vertx\jphp\core\dns\DnsClient
createDnsClient()
Create a DNS client to connect to a DNS server
param $options [DnsClientOptions | array] the client options createDnsClient($options)
Create a DNS client to connect to a DNS server at the specified host and port, with the default query timeout (5 seconds)
param $port [integer] the port param $host [string] the host createDnsClient($port, $host)
DnsClientOptions | array | integer
string
\io\vertx\jphp\core\dns\DnsClient
the DNS client
createHttpClient( $arg0 = null) : \io\vertx\jphp\core\http\HttpClient
createHttpClient()
Create a HTTP/HTTPS client using the specified options
param $options [HttpClientOptions | array] the options to use createHttpClient($options)
array | HttpClientOptions
\io\vertx\jphp\core\http\HttpClient
the client
createHttpServer( $arg0 = null) : \io\vertx\jphp\core\http\HttpServer
createHttpServer()
Create an HTTP/HTTPS server using the specified options
param $options [HttpServerOptions | array] the options to use createHttpServer($options)
array | HttpServerOptions
\io\vertx\jphp\core\http\HttpServer
the server
createNetClient( $arg0 = null) : \io\vertx\jphp\core\net\NetClient
createNetClient()
Create a TCP/SSL client using the specified options
param $options [NetClientOptions | array] the options to use createNetClient($options)
NetClientOptions | array
\io\vertx\jphp\core\net\NetClient
the client
createNetServer( $arg0 = null) : \io\vertx\jphp\core\net\NetServer
createNetServer()
Create a TCP/SSL server using the specified options
param $options [NetServerOptions | array] the options to use createNetServer($options)
array | NetServerOptions
\io\vertx\jphp\core\net\NetServer
the server
createSharedWorkerExecutor( $arg0, $arg1 = null, $arg2 = null, $arg3 = null) : \io\vertx\jphp\core\WorkerExecutor
param $name [string] createSharedWorkerExecutor($name)
Like @see \io\vertx\jphp\core\Vertx::createSharedWorkerExecutor but with the @see \io\vertx\jphp\core\VertxOptions maxExecuteTime
.
param $name [string] param $poolSize [integer] createSharedWorkerExecutor($name, $poolSize)
Like @see \io\vertx\jphp\core\Vertx::createSharedWorkerExecutor but with the .
param $name [string] param $poolSize [integer] param $maxExecuteTime [integer] createSharedWorkerExecutor($name, $poolSize, $maxExecuteTime)
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 @see \io\vertx\jphp\core\WorkerExecutor sharing the same name are closed.
param $name [string] the name of the worker executor param $poolSize [integer] the size of the pool param $maxExecuteTime [integer] the value of max worker execute time param $maxExecuteTimeUnit [string] the value of unit of max worker execute time createSharedWorkerExecutor($name, $poolSize, $maxExecuteTime, $maxExecuteTimeUnit)
string
integer
integer
string
\io\vertx\jphp\core\WorkerExecutor
currentContext() : \io\vertx\jphp\core\Context
deploymentIDs() : array
array
Set of deployment IDs
deployVerticle( $arg0, $arg1 = null, $arg2 = null) : void
Given the name, Vert.x selects a instance to use to instantiate the verticle.
For the rules on how factories are selected please consult the user manual. param $name [string] the name. deployVerticle($name) Like @see \io\vertx\jphp\core\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. param $name [string] The identifier param $completionHandler [callable] a handler which will be notified when the deployment is complete deployVerticle($name, $completionHandler) Like @see \io\vertx\jphp\core\Vertx::deployVerticle but @see \io\vertx\jphp\core\DeploymentOptions are provided to configure the deployment. param $name [string] the name param $options [DeploymentOptions | array] the deployment options. deployVerticle($name, $options) Like @see \io\vertx\jphp\core\Vertx::deployVerticle but @see \io\vertx\jphp\core\DeploymentOptions are provided to configure the deployment. param $name [string] the name param $options [DeploymentOptions | array] the deployment options. param $completionHandler [callable] a handler which will be notified when the deployment is complete deployVerticle($name, $options, $completionHandler)
string
callable | DeploymentOptions | array
callable
eventBus() : \io\vertx\jphp\core\eventbus\EventBus
exceptionHandler( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
executeBlocking( $arg0, $arg1, $arg2 = null) : void
param $blockingCodeHandler [callable] param $resultHandler [callable] executeBlocking($blockingCodeHandler, $resultHandler)
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 @see \io\vertx\jphp\core\Future::complete or @see \io\vertx\jphp\core\Future::complete method, or the @see \io\vertx\jphp\core\Future::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.
param $blockingCodeHandler [callable] handler representing the blocking code to run
param $ordered [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
param $resultHandler [callable] handler that will be called when the blocking code is complete
executeBlocking($blockingCodeHandler, $ordered, $resultHandler)
callable
callable | boolean
callable
fileSystem() : \io\vertx\jphp\core\file\FileSystem
getOrCreateContext() : \io\vertx\jphp\core\Context
isClustered() : boolean
boolean
true if clustered
isMetricsEnabled() : boolean
boolean
{@code true} if metrics are enabled
isNativeTransportEnabled() : boolean
boolean
whether the native transport is used
periodicStream( $arg0) : \io\vertx\jphp\core\TimeoutStream
runOnContext( $arg0) : void
callable
setPeriodic( $arg0, $arg1) : integer
integer
callable
integer
the unique ID of the timer
setTimer( $arg0, $arg1) : integer
integer
callable
integer
the unique ID of the timer
sharedData() : \io\vertx\jphp\core\shareddata\SharedData
timerStream( $arg0) : \io\vertx\jphp\core\TimeoutStream
undeploy( $arg0, $arg1 = null) : void
The actual undeployment happens asynchronously and may not complete until after the method has returned. param $deploymentID [string] the deployment ID undeploy($deploymentID) Like @see \io\vertx\jphp\core\Vertx #undeploy(String) but the completionHandler will be notified when the undeployment is complete. param $deploymentID [string] the deployment ID param $completionHandler [callable] a handler which will be notified when the undeployment is complete undeploy($deploymentID, $completionHandler)
string
callable
vertx( $arg0 = null) : \io\vertx\jphp\core\Vertx
vertx()
Creates a non clustered instance using the specified options
param $options [VertxOptions | array] the options to use vertx($options)
array | VertxOptions
\io\vertx\jphp\core\Vertx
the instance