Interface Mqtt3BlockingClient.Mqtt3Publishes

All Superinterfaces:
AutoCloseable
Enclosing interface:
Mqtt3BlockingClient

@DoNotImplement public static interface Mqtt3BlockingClient.Mqtt3Publishes extends AutoCloseable
Resource which queues incoming Publish messages until they are received.
  • Method Details

    • receive

      @NotNull @NotNull Mqtt3Publish receive() throws InterruptedException
      Receives the next incoming Publish message.
      • Might return immediately if there is already a Publish message queued in this Mqtt3BlockingClient.Mqtt3Publishes instance.
      • Otherwise blocks the calling thread until a Publish message is received.
      Returns:
      the received Publish message.
      Throws:
      InterruptedException - if the calling thread is interrupted while waiting for a Publish message to be received.
    • receive

      @NotNull @NotNull Optional<Mqtt3Publish> receive(long timeout, @NotNull @NotNull TimeUnit timeUnit) throws InterruptedException
      Receives the next incoming Publish message.
      • Might return immediately if there is already a Publish message queued in this Mqtt3BlockingClient.Mqtt3Publishes instance.
      • Otherwise blocks the calling thread until a Publish message is received or the given timeout applies.
      Parameters:
      timeout - the time to wait for a Publish messages to be received.
      timeUnit - the time unit of the timeout parameter.
      Returns:
      an Optional containing the received Publish message, or empty if no Publish message was received in the given timeout period.
      Throws:
      InterruptedException - if the calling thread is interrupted while waiting for a Publish message to be received.
    • receiveNow

      @NotNull @NotNull Optional<Mqtt3Publish> receiveNow()
      Receives the next incoming Publish message if it is already queued in this Mqtt3BlockingClient.Mqtt3Publishes instance.
      Returns:
      an Optional containing the already queued Publish message, or empty if no Publish message was already queued.
    • close

      void close()
      Specified by:
      close in interface AutoCloseable