Add back .join() method removed by accident

This commit is contained in:
Nuno Campos
2023-10-22 19:41:11 +01:00
parent f0e31a8ffa
commit f3291ca0f6
+9
View File
@@ -82,6 +82,15 @@ class PregelInvoke(RunnableBinding):
**other_kwargs,
)
def join(self, channels: Sequence[str]) -> PregelInvoke:
joiner = RunnablePassthrough.assign(
**{chan: PregelRead(chan) for chan in channels}
)
if isinstance(self.bound, RunnablePassthrough):
return PregelInvoke(channels=self.channels, bound=joiner)
else:
return PregelInvoke(channels=self.channels, bound=self.bound | joiner)
def __or__(
self,
other: Runnable[Any, Other]