The composite future wraps a list of @see \io\vertx\jphp\core\Future futures, it is useful when several futures needs to be coordinated.
The handlers set for the coordinated futures are overridden by the handler of the composite future.
The execution context of a {@link io.vertx.core.Handler} execution.
When Vert.x provides an event to a handler or calls the start or stop methods of a \io\vertx\jphp\core\io.vertx.core.Verticle,
the execution is associated with a Context
.
Usually a context is an *event-loop context* and is tied to a specific event loop thread. So executions for that context always occur on that exact same event loop thread.
In the case of worker verticles and running inline blocking code a worker context will be associated with the execution which will use a thread from the worker thread pool.
When a handler is set by a thread associated with a specific context, the Vert.x will guarantee that when that handler is executed, that execution will be associated with the same context.
If a handler is set by a thread not associated with a context (i.e. a non Vert.x thread). Then a new context will be created for that handler.
In other words, a context is propagated.
This means that when a verticle is deployed, any handlers it sets will be associated with the same context - the context of the verticle.
This means (in the case of a standard verticle) that the verticle code will always be executed with the exact same thread, so you don't have to worry about multi-threaded acccess to the verticle state and you can code your application as single threaded.
This class also allows arbitrary data to be @see \io\vertx\jphp\core\Context::put and @see \io\vertx\jphp\core\Context::get on the context so it can be shared easily amongst different handlers of, for example, a verticle instance.
This class also provides @see \io\vertx\jphp\core\Context::runOnContext which allows an action to be executed asynchronously using the same context.
This class represents a MultiMap of String keys to a List of String values.
It's useful in Vert.x to represent things in Vert.x like HTTP headers and HTTP parameters which allow multiple values for keys.
A timeout stream is triggered by a timer, the {@link io.vertx.core.Handler} will be call when the timer is fired, it can be once or several times depending on the nature of the timer related to this stream. The will be called after the timer handler has been called.
Pausing the timer inhibits the timer shots until the stream is resumed. Setting a null handler callback cancels the timer.
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,
Most data is shuffled around inside Vert.x using buffers.
A buffer is a sequence of zero or more bytes that can read from or written to and which expands automatically as necessary to accommodate any bytes written to it. You can perhaps think of a buffer as smart byte array.
Please consult the documentation for more information on buffers.
Defines a command line argument. Unlike options, argument don't have names and are identified using an index. The first index is 0 (because we are in the computer world).
Interface defining a command-line interface (in other words a command such as 'run', 'ls'.
..). This interface is polyglot to ease reuse such as in Vert.x Shell.
A command line interface has a name, and defines a set of options and arguments. Options are key-value pair such
as -foo=bar
or -flag
. The supported formats depend on the used parser. Arguments are unlike
options raw values. Options are defined using
A received datagram packet (UDP) which contains the data and information about the sender of the data itself.
A datagram socket can be used to send @see \io\vertx\jphp\core\datagram\DatagramPacket's to remote datagram servers and receive @see \io\vertx\jphp\core\datagram\DatagramPackets .
Usually you use a datagram socket to send UDP over the wire. UDP is connection-less which means you are not connected to the remote peer in a persistent way. Because of this you have to supply the address and port of the remote peer when sending data.
You can send data to ipv4 or ipv6 addresses, which also include multicast addresses.
Please consult the documentation for more information on datagram sockets.
Configuration options for Vert.x hostname resolver. The resolver uses the local <i>hosts</i> file and performs DNS <i>A</i> and <i>AAAA</i> queries.
Encapsulates a message being delivered by Vert.x as well as providing control over the message delivery.
Used with event bus interceptors.
Delivery options are used to configure message delivery.
Delivery options allow to configure delivery timeout and message codec name, and to provide any headers that you wish to send with the message.
A Vert.x event-bus is a light-weight distributed messaging system which allows different parts of your application, or different applications and services to communicate with each in a loosely coupled way.
An event-bus supports publish-subscribe messaging, point-to-point messaging and request-response messaging.
Message delivery is best-effort and messages can be lost if failure of all or part of the event bus occurs.
Please refer to the documentation for more information on the event bus.
Represents a message that is received from the event bus in a handler.
Messages have a @see \io\vertx\jphp\core\eventbus\Message::body, which can be null, and also @see \io\vertx\jphp\core\eventbus\Message::headers, which can be empty.
If the message was sent specifying a reply handler, it can be replied to using @see \io\vertx\jphp\core\eventbus\Message::reply.
If you want to notify the sender that processing failed, then @see \io\vertx\jphp\core\eventbus\Message::fail can be called.
An event bus consumer object representing a stream of message to an @see \io\vertx\jphp\core\eventbus\EventBus address that can be read from.
The @see \io\vertx\jphp\core\eventbus\EventBus::consumer or @see \io\vertx\jphp\core\eventbus\EventBus::localConsumer creates a new consumer, the returned consumer is not yet registered against the event bus. Registration is effective after the @see \io\vertx\jphp\core\eventbus\MessageConsumer::handler method is invoked.
The consumer is unregistered from the event bus using the @see \io\vertx\jphp\core\eventbus\MessageConsumer::unregister method or by calling the
Represents a file on the file-system which can be read from, or written to asynchronously.
This class also implements @see \io\vertx\jphp\core\streams\ReadStream and
Contains a broad set of operations for manipulating files on the file system.
A (potential) blocking and non blocking version of each operation is provided.
The non blocking versions take a handler which is called when the operation completes or an error occurs.
The blocking versions are named xxxBlocking
and return the results, or throw exceptions directly.
In many cases, depending on the operating system and file system some of the potentially blocking operations
can return quickly, which is why we provide them, but it's highly recommended that you test how long they take to
return in your particular application before using them on an event loop.
Please consult the documentation for more information on file system support.
HTTP2 settings, the settings is initialized with the default HTTP/2 values.<p>
The settings expose the parameters defined by the HTTP/2 specification, as well as extra settings for protocol extensions.
An asynchronous HTTP client.
It allows you to make requests to HTTP servers, and a single client can make requests to any server.
It also allows you to open WebSockets to servers.
The client can also pool HTTP connections.
For pooling to occur, keep-alive must be true on the @see \io\vertx\jphp\core\http\HttpClientOptions (default is true). In this case connections will be pooled and re-used if there are pending HTTP requests waiting to get a connection, otherwise they will be closed.
This gives the benefits of keep alive when the client is loaded but means we don't keep connections hanging around unnecessarily when there would be no benefits anyway.
The client also supports pipe-lining of requests. Pipe-lining means another request is sent on the same connection before the response from the preceding one has returned. Pipe-lining is not appropriate for all requests.
To enable pipe-lining, it must be enabled on the @see \io\vertx\jphp\core\http\HttpClientOptions (default is false).
When pipe-lining is enabled the connection will be automatically closed when all in-flight responses have returned and there are no outstanding pending requests to write.
The client is designed to be reused between requests.
Options describing how an @see \io\vertx\jphp\core\http\HttpClient will make connections.
Represents a client-side HTTP request.
Instances are created by an @see \io\vertx\jphp\core\http\HttpClient instance, via one of the methods corresponding to the specific HTTP methods, or the generic request methods. On creation the request will not have been written to the wire.
Once a request has been obtained, headers can be set on it, and data can be written to its body if required. Once you are ready to send the request, one of the @see \io\vertx\jphp\core\http\HttpClientRequest::end methods should be called.
Nothing is actually sent until the request has been internally assigned an HTTP connection.
The @see \io\vertx\jphp\core\http\HttpClient instance will return an instance of this class immediately, even if there are no HTTP connections available in the pool. Any requests sent before a connection is assigned will be queued internally and actually sent when an HTTP connection becomes available from the pool.
The headers of the request are queued for writing either when the @see \io\vertx\jphp\core\http\HttpClientRequest::end method is called, or, when the first part of the body is written, whichever occurs first.
This class supports both chunked and non-chunked HTTP.
It implements @see \io\vertx\jphp\core\streams\WriteStream so it can be used with
Represents a client-side HTTP response.
Vert.x provides you with one of these via the handler that was provided when creating the @see \io\vertx\jphp\core\http\HttpClientRequest or that was set on the @see \io\vertx\jphp\core\http\HttpClientRequest instance.
It implements @see \io\vertx\jphp\core\streams\ReadStream so it can be used with
Represents an HTTP connection.
HTTP/1.x connection provides an limited implementation, the following methods are implemented:
An HTTP and WebSockets server.
You receive HTTP requests by providing a @see \io\vertx\jphp\core\http\HttpServer::requestHandler. As requests arrive on the server the handler will be called with the requests.
You receive WebSockets by providing a @see \io\vertx\jphp\core\http\HttpServer::websocketHandler. As WebSocket connections arrive on the server, the WebSocket is passed to the handler.
Represents options used by an @see \io\vertx\jphp\core\http\HttpServer instance
Represents a server-side HTTP request.
Instances are created for each request and passed to the user via a handler.
Each instance of this class is associated with a corresponding @see \io\vertx\jphp\core\http\HttpServerResponse instance via
Represents a server-side HTTP response.
An instance of this is created and associated to every instance of
Options describing how an @see \io\vertx\jphp\core\http\HttpClient will make connect to make a request.
Represents a server side WebSocket.
Instances of this class are passed into a @see \io\vertx\jphp\core\http\HttpServer::websocketHandler or provided when a WebSocket handshake is manually @see \io\vertx\jphp\core\http\HttpServerRequest::upgradeed.
This class represents HTTP/2 stream priority defined in RFC 7540 clause 5.3
Base WebSocket implementation.
It implements both and so it can be used with
A WebSocket frame that represents either text or binary data.
A WebSocket message is composed of one or more WebSocket frames.
If there is a just a single frame in the message then a single text or binary frame should be created with final = true.
If there are more than one frames in the message, then the first frame should be a text or binary frame with final = false, followed by one or more continuation frames. The last continuation frame should have final = true.
Configures a @see \io\vertx\jphp\core\net\TCPSSLOptions to use the JDK ssl engine implementation.
Key or trust store options configuring private key and/or certificates based on Java Keystore files.
When used as a key store, it should point to a store containing a private key and its certificate. When used as a trust store, it should point to a store containing a list of trusted certificates.
The store can either be loaded by Vert.x from the filesystem:
HttpServerOptions options = HttpServerOptions.httpServerOptions(); options.setKeyStore(new JKSOptions().setPath("/mykeystore.jks").setPassword("foo"));Or directly provided as a buffer:
Buffer store = vertx.fileSystem().readFileSync("/mykeystore.jks"); options.setKeyStore(new JKSOptions().setValue(store).setPassword("foo"));
A TCP client.
Multiple connections to different servers can be made using the same instance.
This client supports a configurable number of connection attempts and a configurable delay between attempts.
Represents a socket-like interface to a TCP connection on either the client or the server side.
Instances of this class are created on the client side by an @see \io\vertx\jphp\core\net\NetClient when a connection to a server is made, or on the server side by a @see \io\vertx\jphp\core\net\NetServer when a server accepts a connection.
It implements both and so it can be used with
Configures a @see \io\vertx\jphp\core\net\TCPSSLOptions to use OpenSsl.
Key store options configuring a list of private key and its certificate based on <i>Privacy-enhanced Electronic Email</i> (PEM) files.
A key file must contain a non encrypted private key in PKCS8 format wrapped in a PEM block, for example:
-----BEGIN PRIVATE KEY----- MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDV6zPk5WqLwS0a ... K5xBhtm1AhdnZjx5KfW3BecE -----END PRIVATE KEY-----
Or contain a non encrypted private key in PKCS1 format wrapped in a PEM block, for example:
-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAlO4gbHeFb/fmbUF/tOJfNPJumJUEqgzAzx8MBXv9Acyw9IRa ... zJ14Yd+t2fsLYVs2H0gxaA4DW6neCzgY3eKpSU0EBHUCFSXp/1+/ -----END RSA PRIVATE KEY-----
A certificate file must contain an X.509 certificate wrapped in a PEM block, for example:
-----BEGIN CERTIFICATE----- MIIDezCCAmOgAwIBAgIEZOI/3TANBgkqhkiG9w0BAQsFADBuMRAwDgYDVQQGEwdV ... +tmLSvYS39O2nqIzzAUfztkYnUlZmB0l/mKkVqbGJA== -----END CERTIFICATE-----Keys and certificates can either be loaded by Vert.x from the filesystem:
HttpServerOptions options = new HttpServerOptions(); options.setPemKeyCertOptions(new PemKeyCertOptions().setKeyPath("/mykey.pem").setCertPath("/mycert.pem"));Or directly provided as a buffer:
Buffer key = vertx.fileSystem().readFileSync("/mykey.pem"); Buffer cert = vertx.fileSystem().readFileSync("/mycert.pem"); options.setPemKeyCertOptions(new PemKeyCertOptions().setKeyValue(key).setCertValue(cert));Several key/certificate pairs can be used:
HttpServerOptions options = new HttpServerOptions(); options.setPemKeyCertOptions(new PemKeyCertOptions() .addKeyPath("/mykey1.pem").addCertPath("/mycert1.pem") .addKeyPath("/mykey2.pem").addCertPath("/mycert2.pem"));
Certificate Authority options configuring certificates based on <i>Privacy-enhanced Electronic Email</i> (PEM) files. The options is configured with a list of validating certificates.
Validating certificates must contain X.509 certificates wrapped in a PEM block:
-----BEGIN CERTIFICATE----- MIIDezCCAmOgAwIBAgIEVmLkwTANBgkqhkiG9w0BAQsFADBuMRAwDgYDVQQGEwdV ... z5+DuODBJUQst141Jmgq8bS543IU/5apcKQeGNxEyQ== -----END CERTIFICATE-----The certificates can either be loaded by Vert.x from the filesystem:
HttpServerOptions options = new HttpServerOptions(); options.setPemTrustOptions(new PemTrustOptions().addCertPath("/cert.pem"));Or directly provided as a buffer:
Buffer cert = vertx.fileSystem().readFileSync("/cert.pem"); HttpServerOptions options = new HttpServerOptions(); options.setPemTrustOptions(new PemTrustOptions().addCertValue(cert));
Key or trust store options configuring private key and/or certificates based on PKCS#12 files.
When used as a key store, it should point to a store containing a private key and its certificate. When used as a trust store, it should point to a store containing a list of accepted certificates.
The store can either be loaded by Vert.x from the filesystem:
HttpServerOptions options = new HttpServerOptions(); options.setPfxKeyCertOptions(new PfxOptions().setPath("/mykeystore.p12").setPassword("foo"));Or directly provided as a buffer:
Buffer store = vertx.fileSystem().readFileSync("/mykeystore.p12"); options.setPfxKeyCertOptions(new PfxOptions().setValue(store).setPassword("foo"));
A self-signed certificate helper for testing and development purposes.
While it helps for testing and development, it should never ever be used in production settings.
The address of a socket, an inet socket address or a domain socket address.
Use @see \io\vertx\jphp\core\net\SocketAddress::inetSocketAddress to create an inet socket address and @see \io\vertx\jphp\core\net\SocketAddress::domainSocketAddress to create a domain socket address
A parser class which allows to incrementally parse json elements and emit json parse events instead of parsing a json element fully. This parser is convenient for parsing large json structures.
The parser also parses concatenated json streams or line delimited json streams.
The parser can also parse entire object or array when it is convenient, for instance a very large array of small objects can be parsed efficiently by handling array start/end and object events.
Whenever the parser fails to parse or process the stream, the @see \io\vertx\jphp\core\parsetools\JsonParser::exceptionHandler is called with the cause of the failure and the current handling stops. After such event, the parser should not handle data anymore.
A helper class which allows you to easily parse protocols which are delimited by a sequence of bytes, or fixed size records.
Instances of this class take as input @see \io\vertx\jphp\core\buffer\Buffer instances containing raw bytes, and output records.
For example, if I had a simple ASCII text protocol delimited by '\n' and the input was the following:
buffer1:HELLO\nHOW ARE Y buffer2:OU?\nI AM buffer3: DOING OK buffer4:\nThen the output would be:
buffer1:HELLO buffer2:HOW ARE YOU? buffer3:I AM DOING OKInstances of this class can be changed between delimited mode and fixed size record mode on the fly as individual records are read, this allows you to parse protocols where, for example, the first 5 records might all be fixed size (of potentially different sizes), followed by some delimited records, followed by more fixed size records.
Instances of this class can't currently be used for protocols where the text is encoded with something other than a 1-1 byte-char mapping.
Please see the documentation for more information.
An asynchronous counter that can be used to across the cluster to maintain a consistent count.
Local maps can be used to share data safely in a single Vert.x instance.
By default the map allows immutable keys and values. Custom keys and values should implement \io\vertx\jphp\core\shareddata\io.vertx.core.shareddata.Shareable interface. The map returns their copies.
This ensures there is no shared access to mutable state from different threads (e.g. different event loops) in the Vert.x instance, and means you don't have to protect access to that state using synchronization or locks.
Since the version 3.4, this class extends the interface. However some methods are only accessible in Java.
Pumps data from a @see \io\vertx\jphp\core\streams\ReadStream to a @see \io\vertx\jphp\core\streams\WriteStream and performs flow control where necessary to prevent the write stream buffer from getting overfull.
Instances of this class read items from a @see \io\vertx\jphp\core\streams\ReadStream and write them to a @see \io\vertx\jphp\core\streams\WriteStream. If data can be read faster than it can be written this could result in the write queue of the @see \io\vertx\jphp\core\streams\WriteStream growing without bound, eventually causing it to exhaust all available RAM.
To prevent this, after each write, instances of this class check whether the write queue of the @see \io\vertx\jphp\core\streams\WriteStream is full, and if so, the @see \io\vertx\jphp\core\streams\ReadStream is paused, and a drainHandler
is set on the
Represents a stream of items that can be read from.
Any class that implements this interface can be used by a @see \io\vertx\jphp\core\streams\Pump to pump data from it to a @see \io\vertx\jphp\core\streams\WriteStream.
handler
.handler
.0