Closed maxfischer2781 closed 7 years ago
Main issue of the draft is that it does not reflect identity. With the paths [ a >> b, a >> c]
for a >> (b, c)
, a
is traversed twice when it should be only once.
A path iterator may be more appropriate, but requires checking for forks and chains and the like.
Iteration over chains/trees can be broken down into the following primitives of input->output:
step
: 1 -> 1fork
: 1 -> njoin
: n -> 1A flag on elements could expose this easily to iterators.
Each ChainLink
defaults to 1->1
connections, but can use the flags chain_join
and chain_fork
to mark itself as a n->?
and ?->n
connection. Standard objects use this already, and chains are sensitive to it. The joinlet
and forklet
decorators set the respective attributes.
Changes are part of the current release.
The abstraction to chains and graphs does not expose concurrency: only a top-level fork of producers can be detected and requires inspection of the chain.
A possible solution is for chains/graphs to provide paths - a collection of each sequence the chain/graph encodes. For example, the graph
a >> (b, c)
creates the paths[ a >> b, a >> c]
. A path is a linear chain, and a linear chain provides itself as its only path.Paths could be the entities that drivers work on, allowing the appropriate parallelisation. This should also allows asyncio drivers.