Interface BlockingSender

All Superinterfaces:
Sender
All Known Subinterfaces:
WebSocketClientConnection, WebSocketConnection, WebSocketConnection.BroadcastSender
All Known Implementing Classes:
WebSocketClientConnectionImpl, WebSocketConnectionImpl

@Experimental("This API is experimental and may change in the future") public interface BlockingSender extends Sender
Sends messages to the connected WebSocket client and waits for the completion.

Note that blocking sender methods should never be called on an event loop thread.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    sendBinaryAndAwait(byte[] message)
    Sends a binary message and waits for the completion.
    default void
    sendBinaryAndAwait(io.vertx.core.buffer.Buffer message)
    Sends a binary message and waits for the completion.
    default void
    sendPingAndAwait(io.vertx.core.buffer.Buffer data)
    Send a ping message and waits for the completion.
    default void
    sendPongAndAwait(io.vertx.core.buffer.Buffer data)
    Send an unsolicited pong message and waits for the completion.
    default void
    Sends a text message and waits for the completion.
    default <M> void
    sendTextAndAwait(M message)
    Sends a text message and waits for the completion.

    Methods inherited from interface io.quarkus.websockets.next.Sender

    sendBinary, sendBinary, sendPing, sendPong, sendText, sendText
  • Method Details

    • sendTextAndAwait

      default void sendTextAndAwait(String message)
      Sends a text message and waits for the completion.
      Parameters:
      message -
    • sendTextAndAwait

      default <M> void sendTextAndAwait(M message)
      Sends a text message and waits for the completion.
      Type Parameters:
      M -
      Parameters:
      message -
    • sendBinaryAndAwait

      default void sendBinaryAndAwait(io.vertx.core.buffer.Buffer message)
      Sends a binary message and waits for the completion.
      Parameters:
      message -
    • sendBinaryAndAwait

      default void sendBinaryAndAwait(byte[] message)
      Sends a binary message and waits for the completion.
      Parameters:
      message -
    • sendPingAndAwait

      default void sendPingAndAwait(io.vertx.core.buffer.Buffer data)
      Send a ping message and waits for the completion.
      Parameters:
      data - May be at most 125 bytes
    • sendPongAndAwait

      default void sendPongAndAwait(io.vertx.core.buffer.Buffer data)
      Send an unsolicited pong message and waits for the completion.

      Note that the server automatically responds to a ping message sent from the client. However, the RFC 6455 section 5.5.3 states that unsolicited pong may serve as a unidirectional heartbeat.

      Parameters:
      data - May be at most 125 bytes