Class ServerEventStream

java.lang.Object
cool.scx.http.media.event_stream.ServerEventStream
All Implemented Interfaces:
AutoCloseable

public class ServerEventStream extends Object implements AutoCloseable
  • Constructor Details

    • ServerEventStream

      public ServerEventStream(cool.scx.io.ByteOutput out)
  • Method Details

    • send

      public void send(SseEvent sseEvent) throws HttpSendException
      发送一个 SSE 事件
      Parameters:
      sseEvent - 要发送的 SSE 事件
      Throws:
      HttpSendException
    • close

      public void close() throws cool.scx.io.exception.ScxIOException, cool.scx.io.exception.AlreadyClosedException
      Specified by:
      close in interface AutoCloseable
      Throws:
      cool.scx.io.exception.ScxIOException
      cool.scx.io.exception.AlreadyClosedException