Hi Francis, You could inherit from the original `KeyedProcessFunction` to process async state. Please do remember to use the ForSt Statebackends, which is the only one that supports asynchronous state access. If your state size is huge, you will get the benefit.
The `DeclaringAsyncKeyedProcessFunction` API is for faster checkpoint, which is still under development. Best, Zakelly On Wed, Sep 24, 2025 at 7:18 PM Francis Altomare < [email protected]> wrote: > Hello everyone, > > I have a question about using the Async state APIs in a > KeyedProcessFunction. I’m defining a pipeline like this, > keyBy(KeySelector()).enableAsyncState().process(MyKeyedProcessFunction()). > Inside MyKeyedProcessFunction I’m using the > org.apache.flink.api.common.state.v2.ValueState APIs: > > override fun processElement(value: Event context: Context, out: > Collector<Event>) { > > state.asyncValue().thenApply { value -> > > // more async state operations > > out.collect(updatedValue) > > } > > } > > My question is if this kind of async state access also requires my > KeyedProcessFunction to inherit from DeclaringAsyncKeyedProcessFunction? > Since I’m now accessing the state asynchronously, is there a benefit to > using DeclaringAsyncKeyedProcessFunction? > > Thanks a lot, > > Francis >
