Class LiveServerSessionResumptionUpdate.Builder
-
- All Implemented Interfaces:
public abstract class LiveServerSessionResumptionUpdate.BuilderBuilder for LiveServerSessionResumptionUpdate.
-
-
Constructor Summary
Constructors Constructor Description LiveServerSessionResumptionUpdate.Builder()
-
Method Summary
Modifier and Type Method Description abstract LiveServerSessionResumptionUpdate.BuildernewHandle(String newHandle)Setter for newHandle. LiveServerSessionResumptionUpdate.BuilderclearNewHandle()Clears the value of newHandle field. abstract LiveServerSessionResumptionUpdate.Builderresumable(boolean resumable)Setter for resumable. LiveServerSessionResumptionUpdate.BuilderclearResumable()Clears the value of resumable field. abstract LiveServerSessionResumptionUpdate.BuilderlastConsumedClientMessageIndex(Long lastConsumedClientMessageIndex)Setter for lastConsumedClientMessageIndex. LiveServerSessionResumptionUpdate.BuilderclearLastConsumedClientMessageIndex()Clears the value of lastConsumedClientMessageIndex field. abstract LiveServerSessionResumptionUpdatebuild()-
-
Method Detail
-
newHandle
abstract LiveServerSessionResumptionUpdate.Builder newHandle(String newHandle)
Setter for newHandle.
newHandle: New handle that represents state that can be resumed. Empty if `resumable`=false.
-
clearNewHandle
@CanIgnoreReturnValue() LiveServerSessionResumptionUpdate.Builder clearNewHandle()
Clears the value of newHandle field.
-
resumable
abstract LiveServerSessionResumptionUpdate.Builder resumable(boolean resumable)
Setter for resumable.
resumable: True if session can be resumed at this point. It might be not possible to resume session at some points. In that case we send update empty new_handle and resumable=false. Example of such case could be model executing function calls or just generating. Resuming session (using previous session token) in such state will result in some data loss.
-
clearResumable
@CanIgnoreReturnValue() LiveServerSessionResumptionUpdate.Builder clearResumable()
Clears the value of resumable field.
-
lastConsumedClientMessageIndex
abstract LiveServerSessionResumptionUpdate.Builder lastConsumedClientMessageIndex(Long lastConsumedClientMessageIndex)
Setter for lastConsumedClientMessageIndex.
lastConsumedClientMessageIndex: Index of last message sent by client that is included in state represented by this SessionResumptionToken. Only sent when `SessionResumptionConfig.transparent` is set.
Presence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last `SessionResmumptionTokenUpdate`. This field will enable them to limit buffering (avoid keeping all requests in RAM).
Note: This should not be used for when resuming a session at some time later -- in those cases partial audio and video frames arelikely not needed.
-
clearLastConsumedClientMessageIndex
@CanIgnoreReturnValue() LiveServerSessionResumptionUpdate.Builder clearLastConsumedClientMessageIndex()
Clears the value of lastConsumedClientMessageIndex field.
-
build
abstract LiveServerSessionResumptionUpdate build()
-
-
-
-