Module vertx.values
Package vertxval

Class VerticleRef<I,​O>

  • Type Parameters:
    I - the type of the input message sent to this verticle
    O - the type of the output message returned by this verticle

    public class VerticleRef<I,​O>
    extends Object
    It represents a reference to a Verticle, the unit of computation. It allows to send messages to the Verticle with the method tell(DeliveryOptions), or establish conversations with the method ask(DeliveryOptions).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      String address
      address where a verticle is listening on
      Set<String> ids
      the identifiers assigned to the different instances of this verticle after being deployed.
    • Field Detail

      • address

        public final String address
        address where a verticle is listening on
      • ids

        public final Set<String> ids
        the identifiers assigned to the different instances of this verticle after being deployed. To undeploy a verticle, its identifier is needed.
    • Method Detail

      • ask

        public λ<I,​O> ask​(io.vertx.core.eventbus.DeliveryOptions options)
        Method to establish a conversation with this verticle: a message is sent and then a message is received.
        Parameters:
        options - the delivery options
        Returns:
        a function that takes an object of type I and returns an object of type O wrapped in a future
      • trace

        public λc<I,​O> trace​(io.vertx.core.eventbus.DeliveryOptions options)
      • ask

        public λ<I,​O> ask()
        Method to establish a conversation with this verticle: a message is sent and then a message is received.
        Returns:
        a function that takes an object of type I and returns an object of type O wrapped in a future
      • trace

        public λc<I,​O> trace()
      • tell

        public Consumer<I> tell​(io.vertx.core.eventbus.DeliveryOptions options)
        Method to send a message to this verticle.
        Parameters:
        options - the delivery options
        Returns:
        a consumer that takes an object of type I
      • tell

        public Consumer<I> tell()
        Method to send a message to this verticle.
        Returns:
        a consumer that takes an object of type I
      • undeploy

        public io.vertx.core.Future<Void> undeploy()
        Undeploy all the instances of this verticle
        Returns:
        a future that will be completed when all the instances are undeployed