fluxus.core.producer.SimpleConcurrentProducer#
- class fluxus.core.producer.SimpleConcurrentProducer(*producers)[source]#
A simple group that manages a collection of producers.
- Bases:
ConcurrentProducer
[+T_SourceProduct_ret]- Generic types:
+T_SourceProduct_ret
- Metaclasses:
- Parameters:
producers (
BaseProducer
[TypeVar
(T_SourceProduct_ret
, covariant=True)]) – the response producer(s) this producer uses to generate response groups
Method summary
Generate new products from all producers in this group asynchronously.
Draw the flow.
Get the connections between conduits in this conduit.
Get an iterator yielding the final atomic conduit or conduits of the (sub)flow represented by this conduit.
Get an iterator yielding the isolated conduits in this conduit.
Iterate over the concurrent producers that make up this (potentially) composite producer.
Generate new products from all producers in this group.
Make an expression representing this conduit.
Attribute summary
self
, since this is a group of concurrent conduits and has no final conduit on a more granular level.True
if this conduit is atomic,False
if it is a chained or concurrent composition of other conduits.True
if this conduit contains a composition of conduits chained together sequentially,False
otherwise.True
, since this is a group of concurrent conduits.The number of concurrent conduits in this conduit.
The name of this conduit.
The type of the products produced by this conduit.
The response sources this producer provides.
Definitions
- aproduce()#
Generate new products from all producers in this group asynchronously.
- Return type:
AsyncIterator
[TypeVar
(T_SourceProduct_ret
, covariant=True)]- Returns:
an async iterator of the new products
- draw(style='graph')#
Draw the flow.
- Parameters:
style (
str
) – the style to use for drawing the flow, seeFlowDrawer
for available styles (defaults to “graph”)- Return type:
- get_connections(*, ingoing)[source]#
Get the connections between conduits in this conduit.
- Parameters:
ingoing (
Collection
[SerialConduit
[Any
]]) – the ingoing conduits, if any- Return type:
- Returns:
an iterator yielding connections between conduits
- get_final_conduits()[source]#
Get an iterator yielding the final atomic conduit or conduits of the (sub)flow represented by this conduit.
If this conduit is atomic, yields the conduit itself.
If this conduit is a sequential composition of conduits, yields the final conduit of that sequence.
If this conduit is a group of concurrent conduits, yields the final conduits of each of the concurrent conduits.
- Return type:
Iterator
[SerialConduit
[TypeVar
(T_SourceProduct_ret
, covariant=True)]]- Returns:
an iterator yielding the final conduits
- get_isolated_conduits()[source]#
Get an iterator yielding the isolated conduits in this conduit.
An isolated conduit is a conduit that is not connected to any other conduit in the flow.
- Return type:
Iterator
[SerialConduit
[TypeVar
(T_SourceProduct_ret
, covariant=True)]]- Returns:
an iterator yielding the isolated conduits
- iter_concurrent_producers()[source]#
Iterate over the concurrent producers that make up this (potentially) composite producer.
- Return type:
Iterator
[SerialProducer
[TypeVar
(T_SourceProduct_ret
, covariant=True)]]- Returns:
an iterator over the concurrent producers
- produce()#
Generate new products from all producers in this group.
- to_expression(*, compact=False)[source]#
Make an expression representing this conduit.
- Parameters:
compact (
bool
) – ifTrue
, use a compact representation using only the subset of conduit attributes fromget_repr_attributes()
; ifFalse
, generate the full representation using all attributes- Return type:
Expression
- Returns:
the expression representing this conduit
- property final_conduit: Self#
self
, since this is a group of concurrent conduits and has no final conduit on a more granular level.
- property is_atomic: bool#
True
if this conduit is atomic,False
if it is a chained or concurrent composition of other conduits.
- property is_chained: bool#
True
if this conduit contains a composition of conduits chained together sequentially,False
otherwise.
-
producers:
tuple
[BaseProducer
[TypeVar
(T_SourceProduct_ret
, covariant=True)],...
]# The response sources this producer provides.