Is there some reason why you can’t use an AsyncFunction? https://nightlies.apache.org/flink/flink-docs-master/api/java/org/apache/flink/streaming/api/functions/async/AsyncFunction.html
Note that when dealing with event time and exactly once, an AsyncFunction provides required support for proper execution. See https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/asyncio/ for more details. — Ken > On Feb 19, 2024, at 12:20 PM, Lasse Nedergaard > <lassenedergaardfl...@gmail.com> wrote: > > Hi. > > I have a case where I would like to collect object from a completeablefuture > future in a flat map function. > I run into some problem where I get an exception regarding a buffer pool that > don’t exists when I collect the objets after some times. I can see if I for > testing don’t return from the function (creating a fori loop with a thread > sleep or wait for the future) it works. > Can anyone explain what going on behind the screen and if possible any hints > for a working solution. > > Thanks in advance > > Med venlig hilsen / Best regards > Lasse Nedergaard > -------------------------- Ken Krugler http://www.scaleunlimited.com Custom big data solutions Flink & Pinot