跳到主要内容

Stream

查看 Markdown

This page lists the Java SDK names for Streams. The doc comment of each API gives its parameters, defaults, and errors. Read them in the Java SDK API reference.

API names​

TaskJava APIDex behavior
Define a Stream and its byte capacityStream.define, with streamCapacityBytesCapacity and trimming
Declare it in the FlowPersistenceSchema.of, returned from getPersistenceSchemaFlow definition
Write a message from a StepStream.writeWrite semantics
Write text chunks in batches from a StepBufferedTextStream.createBuffer text chunks
Write a message from a ClientClient.writeStreamWrite semantics
Read the next messageClient.readStream, with the getResumeToken value of the last messageResumable reads
List retained messages, newest firstClient.listStreamMessagesList messages

Stream.write works in waitFor, execute, and the Flow timeout handler. An RPC handler cannot write a Stream; there, the call throws IllegalStateException. Stream.write sends the message immediately.

Example​

Example: examples/java/src/main/java/io/superdurable/dex/primitives/stream/StreamFlow.java