Class NettySseConnection

java.lang.Object
dev.tachyonmcp.core.transport.netty.sse.NettySseConnection
All Implemented Interfaces:
SseConnection

public final class NettySseConnection extends Object implements SseConnection
SseConnection backed by a Netty Channel. Writes SSE frames as chunked HTTP content and registers a close listener for cleanup.
  • Constructor Details

    • NettySseConnection

      public NettySseConnection(io.netty.channel.Channel channel, Runnable onCloseAction)
  • Method Details

    • channel

      public io.netty.channel.Channel channel()
    • isWritable

      public boolean isWritable()
      Description copied from interface: SseConnection
      Returns true if the underlying channel is writable.
      Specified by:
      isWritable in interface SseConnection
    • send

      public void send(SseEvent event)
      Description copied from interface: SseConnection
      Sends an SSE event to the client.
      Specified by:
      send in interface SseConnection
    • close

      public void close()
      Description copied from interface: SseConnection
      Closes the connection. Idempotent.
      Specified by:
      close in interface SseConnection