Interface GraphQLSubscriptionHandler.FrameSender

Enclosing class:
GraphQLSubscriptionHandler

public static interface GraphQLSubscriptionHandler.FrameSender
Callback interface for sending text frames to the client, with optional delay support.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    send(io.netty.channel.ChannelHandlerContext ctx, String text, Delay delay, Runnable onSent)
    Send a text frame, optionally after a delay, then run onSent.
  • Method Details

    • send

      void send(io.netty.channel.ChannelHandlerContext ctx, String text, Delay delay, Runnable onSent)
      Send a text frame, optionally after a delay, then run onSent.

      onSent MUST be invoked only once the frame has actually been written to the wire (or has been deliberately discarded), never before the delay has elapsed. The subscription sequencer chains the next next message — and ultimately the terminal complete — off this callback, so an implementation that runs it eagerly re-introduces the defect where complete overtakes the delayed next frames and every message is discarded by the client as post-terminal.

      Parameters:
      ctx - the channel context
      text - the text to send
      delay - optional delay before sending (may be null)
      onSent - continuation invoked after the frame has been written or discarded