How can I implement an operator with Flink's DataStream API that sends an event when no data was received from a stream for a certain amount of time?
相关问题
- Timer vs. repetitive background worker
- setInterval doesn't slow down on inactive tab
- Timers not running when screen is turned off / dev
- Can we combine both and count and process time Tri
- How to set timer in an event handler?
相关文章
- How to handle errors in custom MapFunction correct
- Is the HPET directly accessible in Windows?
- Flink: Sharing state in CoFlatMapFunction
- Blinking Button for Simon Says
- Timer Label not updated after switching views (swi
- Indy TIdTCPClient receive text
- A HR timers precision study case
- Chrono Timer Not Converting Seconds Properly
You could set up a time window with a custom trigger function. In the trigger function, every time the an event is received the "onEvent" method would set a processingTimeTrigger to "currentTime + desiredTimeDelay". Then when a new event comes, you delete the trigger that was previously set and make a new one. If an event doesn't come by the time the system time is the time on the processingTimeTrigger, it fires and the window would be processed. Even if no events came, the list of events that are going to be processed would just be empty.
Such an operator can be implemented using a
ProcessFunction
.The
TimeOutFunction
is defined as follows. In this example it uses processing time.