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

Fixed ack for tombstones in cython-stream #39

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions faust/_cython/streams.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ cdef class StreamIterator:
do_ack = stream.enable_acks

value = None
event = None

while value is None:
while value is None and event is None:
await sleep(0, loop=self.loop)
need_slow_get, channel_value = self._try_get_quick_value()
if need_slow_get:
channel_value = await self.chan_slow_get()
value, sensor_state = self._prepare_event(channel_value)
event, value, sensor_state = self._prepare_event(channel_value)

try:
for processor in self.processors:
Expand Down Expand Up @@ -165,10 +166,10 @@ cdef class StreamIterator:
stream_state = self.on_stream_event_in(
tp, offset, self.stream, event)
self.stream._set_current_event(event)
return (event.value, stream_state)
return (event, event.value, stream_state)
else:
self.stream._set_current_event(None)
return channel_value, stream_state
return None, channel_value, stream_state

cdef object _try_get_quick_value(self):
if self.chan_is_channel:
Expand Down