Skip to main content

GrpcCheckpointStreamProtocol

GrpcCheckpointStreamProtocol Objects​

class GrpcCheckpointStreamProtocol(typing.Protocol)

A stream of checkpoints returned by [GrpcClient::checkpoints_stream].

Call next in a loop to receive items; it returns None once the stream is exhausted or cancel has been called.

cancel​

def cancel() -> None

Cancel the stream, dropping the connection and unblocking a pending next.

Idempotent, and safe to call while next is pending — the pending call drops the connection on its way out.

Named cancel rather than close because a close method collides with the disposal method uniffi generates for objects in some languages.

is_canceled​

def is_canceled() -> bool

Whether the stream has been canceled.

next​

async def next() -> typing.Optional[GrpcCheckpointResponse]

Get the next item from the stream.

Returns None once the stream is exhausted or has been canceled. Concurrent calls are serialized; there is no ordering guarantee between them.

An error from the connection or the server ends the stream: there is no reconnect, so every later call returns None, and a caller that wants to resume must open a new stream from the last sequence number it received. An error converting a single item, such as a BCS decode failure, only affects that item; the next call continues with the following one.