Skip to content

Commit 8996e48

Browse files
saivedant169sjrl
andauthored
docs: clarify auto-variadic socket input ordering in connect() (#11053)
Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
1 parent 3d72436 commit 8996e48

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

haystack/core/pipeline/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,12 @@ def connect(self, sender: str, receiver: str) -> "PipelineBase": # noqa: PLR091
446446
If connecting to a component that has several output connections, specify the inputs and output names as
447447
'component_name.connections_name'.
448448
449+
If multiple senders are connected to the same list-typed receiver socket, the socket is
450+
promoted to a lazy variadic socket so it can accept all incoming values. With `Pipeline`,
451+
the resulting list is ordered alphabetically by sender component name, not by the order in
452+
which `connect()` was called. With `AsyncPipeline`, no ordering is guaranteed, since
453+
components in different branches may run in parallel.
454+
449455
:param sender:
450456
The component that delivers the value. This can be either just a component name or can be
451457
in the format `component_name.connection_name` if the component has multiple outputs.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
enhancements:
3+
- |
4+
Document the input ordering behavior of auto-promoted lazy variadic sockets in
5+
``Pipeline.connect()``. When
6+
multiple senders are connected to the same list-typed receiver socket, ordering
7+
depends on the pipeline class. With ``Pipeline``, items are ordered alphabetically
8+
by sender component name (because ``Pipeline.run()`` schedules components in
9+
alphabetical order for deterministic execution), not by the order of ``connect()``
10+
calls. With ``AsyncPipeline``, no ordering is guaranteed, since components in
11+
different branches may run in parallel. The docstrings now point users to a
12+
dedicated joiner component when they need explicit ordering.

0 commit comments

Comments
 (0)