Package ai.nexconn.chatui.handler
Class StreamMessageHandler
-
- All Implemented Interfaces:
public class StreamMessageHandler extends MultiDataHandler
Data handler for streaming message operations.
Manages fetching and delivering incremental stream message content. Deduplicates in-flight requests and exposes data via KEY_FETCH_STREAM_MESSAGE.
- Since:
5.16.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceStreamMessageHandler.StateBusiness-state constants for stream message errors.
-
Field Summary
Fields Modifier and Type Field Description public final static MultiDataHandler.DataKey<UiMessage>KEY_FETCH_STREAM_MESSAGEprotected volatile booleanisAlive
-
Constructor Summary
Constructors Constructor Description StreamMessageHandler()
-
Method Summary
Modifier and Type Method Description voidfetchStreamMessage(String msgUId, boolean isRetry)Fetches streaming message content for the given message UID. voidstop()Stops the handler. -
Methods inherited from class ai.nexconn.chatui.base.BaseHandler
isAlive -
Methods inherited from class ai.nexconn.chatui.base.MultiDataHandler
addDataChangeListener, notifyDataChange, notifyDataError, notifyDataError, replaceDataChangeListener -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
fetchStreamMessage
void fetchStreamMessage(String msgUId, boolean isRetry)
Fetches streaming message content for the given message UID.
Deduplicates concurrent requests for the same message. If the message has already been fetched and
isRetryisfalse, the request is skipped.- Parameters:
msgUId- the unique message ID of the stream messageisRetry-trueto force a re-fetch even if the message was already pulled
-
stop
void stop()
Stops the handler.
-
-
-
-