From de86a46b3d17091f2862cab997315d0effb3bdb8 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Wed, 4 Dec 2024 12:05:32 -0800 Subject: [PATCH] Comment --- libs/langgraph/langgraph/pregel/runner.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/langgraph/langgraph/pregel/runner.py b/libs/langgraph/langgraph/pregel/runner.py index e60ae599b..e680518a5 100644 --- a/libs/langgraph/langgraph/pregel/runner.py +++ b/libs/langgraph/langgraph/pregel/runner.py @@ -133,6 +133,8 @@ def writer( CONFIG_KEY_CALL: partial(call, next_task), }, __reraise_on_exit__=reraise, + # starting a new task in the next tick ensures + # updates from this tick are committed/streamed first __next_tick__=True, ) fut.add_done_callback(partial(self.commit, next_task)) @@ -319,6 +321,9 @@ def writer( __name__=t.name, __cancel_on_exit__=True, __reraise_on_exit__=reraise, + # starting a new task in the next tick ensures + # updates from this tick are committed/streamed first + __next_tick__=True, ), ) fut.add_done_callback(partial(self.commit, next_task))