+1 It sounds good to me.
Regards JB Le 20 mars 2018 à 00:52, à 00:52, Huygaa Batsaikhan <[email protected]> a écrit: >Hi everyone, I am working on BEAM-1589 ><https://issues.apache.org/jira/browse/BEAM-1589>. In short, currently, >there is no default way of saving/flushing state before a window is >garbage >collected. > >My current plan is to provide a method annotation, @OnWindowExpiration, >which allows user-provided callback function to be executed before >garbage >collection. This annotation behaves very similar to @OnTimer, >therefore, >implementation will mostly be a copy of OnTimer code. Let me know if >you >have any considerations and suggestions. > >Here is an example usage: >``` >@OnWindowExpiration >public void myCleanupFunction(OnWindowExpirationContext c, State state) >{ > c.output(state.read()); >} >``` > >Thanks, Huygaa
