Hi Radu, the processElement() and onTimer() calls are synchronized by a lock, i.e., they won't be called at the same time.
Best, Fabian 2017-03-31 9:34 GMT+02:00 Radu Tudoran <radu.tudo...@huawei.com>: > Hi, > > > > I would like to use a processFunction to accumulate elements. Therefore in > the processElement function I will accumulate this element into a state. > However, I would like to emit the output only 1ms later. Therefore I would > register a timer to trigger one second later and read the state and emit it. > > However, I am curious of what happens if in the next ms another event > arrives. In principle both the processElement function and the onTimer > function should be triggered in the same time. My question is: is there a > fix order to execute them? Because if any of them work just like normal > threads, than concurrency related issues could happen when accessing the > state. > > >