Class TaskEvent

java.lang.Object
com.alibaba.dashscope.transport.ws.TaskEvent

public final class TaskEvent extends Object
One inbound item on a TaskChannel: a parsed task-protocol text event, a raw binary frame, the socket-closed signal, or a transport-level failure. Binary frames carry no header, hence no task id (audio design §7: ownership is claimed, not parsed).
  • Method Details

    • getKind

      public TaskEvent.Kind getKind()
    • getTaskId

      public String getTaskId()
      TEXT only: header.task_id.
    • getRequestId

      public String getRequestId()
      TEXT only: header.request_id, falling back to header.task_id.
    • getEvent

      public String getEvent()
      TEXT only: header.event (task-started / result-generated / task-finished / ...).
    • getErrorCode

      public String getErrorCode()
      TEXT only: header.error_code; set on task-failed.
    • getErrorMessage

      public String getErrorMessage()
      TEXT only: header.error_message; set on task-failed.
    • getPayload

      public com.fasterxml.jackson.databind.JsonNode getPayload()
      TEXT only: the payload node (may be null).
    • getRaw

      public com.fasterxml.jackson.databind.JsonNode getRaw()
      TEXT only: the full frame, header included.
    • getBinary

      public ByteBuffer getBinary()
      BINARY only: zero-copy view of the frame.
    • getCloseCode

      public int getCloseCode()
    • getCloseReason

      public String getCloseReason()
    • getFailure

      public RuntimeException getFailure()
      FAILURE only: the transport-level exception.