
文章里面提到了2个问题,
- no state tracking
- do not support complex customized business logic

它们通过updateStateBykey(update_func)/mapWithState(update_func)
来自定义该update过程。即,
- Attach expire date/time when events are first seen & state is initialized
- drop the state if it expires
- apply business logic to new events/current state


我借用了该ppt的思路,试着回答了stackoverflow上面的一个类似提问,但是我自己没有亲身实现出来,只是觉得可能这是一个思路。在每个state initialization的时候初始化一些状态(timeout,control flag等),然后判断这个stages的去留。
网友评论