Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling window close callback after popping the value from store #137

Merged

Conversation

VatsalP
Copy link
Contributor

@VatsalP VatsalP commented Apr 19, 2021

Description

In the current case, if a window is to be closed the start timestamp of the current window is checked against last_closed_window.

if keys_to_remove:
    for key in keys_to_remove:
        value = self.data.pop(key, None)
        if key[1][0] > self.last_closed_window:
            await self.on_window_close(key, value)
    self.last_closed_window = max(
        self.last_closed_window,
        max(key[1][0] for key in keys_to_remove),
    )

Which means in this case if we are using relative_to_field for a Windowed Table and event comes with some old timestamp which is lesser than last_closed_window, then the value would already be popped but the on_window_close wouldn't be called.

Ideally if window is closed we should be calling the on_window_close callback

@patkivikram patkivikram merged commit a7aabfd into faust-streaming:master Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants