Class VertxBuilder

java.lang.Object
io.vertx.mutiny.core.VertxBuilder
All Implemented Interfaces:
MutinyDelegate

public class VertxBuilder extends Object implements MutinyDelegate
A builder for creating Vert.x instances, allowing to configure Vert.x plugins:
  • metrics
  • tracing
  • cluster manager
Example usage:

   Vertx vertx = Vertx.builder().with(options).withMetrics(metricsFactory).build();
 

NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

  • Field Details

  • Constructor Details

    • VertxBuilder

      public VertxBuilder(io.vertx.core.VertxBuilder delegate)
    • VertxBuilder

      public VertxBuilder(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.core.VertxBuilder getDelegate()
      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate used by this Mutiny object of generated type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • with

      public VertxBuilder with(io.vertx.core.VertxOptions options)
      Parameters:
      options - the Vert.x options
      Returns:
      a reference to this, so the API can be used fluently
    • build

      public Vertx build()
      Returns:
      the instance
    • buildClustered

      @CheckReturnValue public io.smallrye.mutiny.Uni<Vertx> buildClustered()
      Creates a clustered instance.

      The instance is created asynchronously and the returned future is completed 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.

      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • buildClusteredAndAwait

      public Vertx buildClusteredAndAwait()
      Blocking variant of buildClustered().

      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 Vertx instance produced by the operation.
    • buildClusteredAndForget

      public void buildClusteredAndForget()
      Variant of buildClustered() that ignores the result of the operation.

      This method subscribes on the result of buildClustered(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from buildClustered() but you don't need to compose it with other operations.

    • withMetrics

      public VertxBuilder withMetrics(io.vertx.core.spi.VertxMetricsFactory factory)
      Parameters:
      factory - the metrics factory
      Returns:
      a reference to this, so the API can be used fluently
    • withTracer

      public VertxBuilder withTracer(io.vertx.core.spi.VertxTracerFactory factory)
      Parameters:
      factory - the tracer factory
      Returns:
      a reference to this, so the API can be used fluently
    • withClusterManager

      public VertxBuilder withClusterManager(io.vertx.core.spi.cluster.ClusterManager clusterManager)
      Parameters:
      clusterManager - the cluster manager
      Returns:
      a reference to this, so the API can be used fluently
    • newInstance

      public static VertxBuilder newInstance(io.vertx.core.VertxBuilder arg)