> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# producer_consumer_for_each class

**Namespace:** [Ans.DataProcessing.operators.utility](https://developer.synopsys.com/docs/dpf/dpf-mechanical/api/Ans.DataProcessing/operators/utility)

## Summary

Allows to write a loop over operators by connecting data to iterate and by requesting the incrementally output merged.The chain of Operators are split into a first part: the producers and a second part: the consumers. These 2 parts will run asynchronously on 2 threads.

available inputs: `producer_consumer_iterableq` (object), `forward1` (object), `forward2` (object)

available outputs: `empty` (object), `output1` (object), `output2` (object)

## Example

```python theme={null}
op = producer_consumer_for_each()

op = producer_consumer_for_each(producer_consumer_iterableq=my_producer_consumer_iterableq,forward1=my_forward1,forward2=my_forward2)
```

## Class Information

| Property | Value |
| - | - |
| Namespace | `Ans.DataProcessing.operators.utility` |
| Assembly | `Ans_Dpf_Native_dll_cs` |
| Base Class | `Ans.DataProcessing.internal_objects.BaseOperator` |

## Inputs

### producer\_consumer\_iterableq

The result of the make\_producer\_consumer\_for\_each\_iterator operator.

**Type:** *LinkableInput*

### forward1

output of the last operators of the workflow

**Type:** *LinkableInput*

### forward2

output of the last operators of the workflow

**Type:** *LinkableInput*

## Outputs

### empty

**Type:** *LinkableOutput*

### output1

**Type:** *LinkableOutput*

### output2

**Type:** *LinkableOutput*

## Constructors

#### Constructor

```python theme={null}
producer_consumer_for_each()
```

#### Constructor

```python theme={null}
producer_consumer_for_each(producer_consumer_iterableq, forward1, forward2, config)
```

**Parameters:**

* `producer_consumer_iterableq` (*object*)
* `forward1` (*object*)
* `forward2` (*object*)
* `config` (*OperatorConfig*)

#### Constructor

```python theme={null}
producer_consumer_for_each(config)
```

**Parameters:**

* `config` (*OperatorConfig*)

## Methods

## Properties

#### inputs

**Type:** *InputSpec*

```python theme={null}
# Get or set the property
value = obj.inputs
obj.inputs = new_value
```

#### outputs

**Type:** *OutputSpec*

```python theme={null}
# Get or set the property
value = obj.outputs
obj.outputs = new_value
```

#### defaultConfig

**Type:** *Config*

```python theme={null}
# Get the property (read-only)
value = obj.defaultConfig
```
