InigoSJ commented on code in PR #23100:
URL: https://github.com/apache/beam/pull/23100#discussion_r966437416


##########
sdks/python/apache_beam/transforms/trigger.py:
##########
@@ -385,8 +388,10 @@ def __repr__(self):
     return 'AfterProcessingTime(delay=%d)' % self.delay
 
   def on_element(self, element, window, context):
-    context.set_timer(
-        '', TimeDomain.REAL_TIME, context.get_current_time() + self.delay)
+    context.add_state(self.COUNT_TAG, 1)
+    if context.get_state(self.COUNT_TAG) == 1:

Review Comment:
   I have modified the logic from a Counter to a State, we don't need to 
actually count the elements, just modify the timer with the first element in 
the pane



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to