Interface Sender

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

@Experimental("This API is experimental and may change in the future") public interface Sender
Sends messages to the connected WebSocket client.
  • Method Summary

    Modifier and Type
    Method
    Description
    default io.smallrye.mutiny.Uni<Void>
    sendBinary(byte[] message)
    Send a binary message.
    io.smallrye.mutiny.Uni<Void>
    sendBinary(io.vertx.core.buffer.Buffer message)
    Send a binary message.
    io.smallrye.mutiny.Uni<Void>
    sendPing(io.vertx.core.buffer.Buffer data)
    Send a ping message.
    io.smallrye.mutiny.Uni<Void>
    sendPong(io.vertx.core.buffer.Buffer data)
    Send an unsolicited pong message.
    io.smallrye.mutiny.Uni<Void>
    sendText(String message)
    Send a text message.
    <M> io.smallrye.mutiny.Uni<Void>
    sendText(M message)
    Send a text message.
  • Method Details

    • sendText

      @CheckReturnValue io.smallrye.mutiny.Uni<Void> sendText(String message)
      Send a text message.
      Parameters:
      message -
      Returns:
      a new Uni with a null item
    • sendText

      @CheckReturnValue <M> io.smallrye.mutiny.Uni<Void> sendText(M message)
      Send a text message.
      Type Parameters:
      M -
      Parameters:
      message -
      Returns:
      a new Uni with a null item
    • sendBinary

      @CheckReturnValue io.smallrye.mutiny.Uni<Void> sendBinary(io.vertx.core.buffer.Buffer message)
      Send a binary message.
      Parameters:
      message -
      Returns:
      a new Uni with a null item
    • sendBinary

      @CheckReturnValue default io.smallrye.mutiny.Uni<Void> sendBinary(byte[] message)
      Send a binary message.
      Parameters:
      message -
      Returns:
      a new Uni with a null item
    • sendPing

      @CheckReturnValue io.smallrye.mutiny.Uni<Void> sendPing(io.vertx.core.buffer.Buffer data)
      Send a ping message.
      Parameters:
      data - May be at most 125 bytes
      Returns:
      a new Uni with a null item
    • sendPong

      @CheckReturnValue io.smallrye.mutiny.Uni<Void> sendPong(io.vertx.core.buffer.Buffer data)
      Send an unsolicited pong message.

      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
      Returns:
      a new Uni with a null item