| 1: | <?php declare(strict_types=1); |
| 2: | |
| 3: | namespace Salient\Contract\Core\Pipeline; |
| 4: | |
| 5: | /** |
| 6: | * @api |
| 7: | * |
| 8: | * @template TInput |
| 9: | * @template TOutput |
| 10: | * @template TArgument |
| 11: | * |
| 12: | * @extends BasePipelineInterface<TInput,TOutput,TArgument> |
| 13: | */ |
| 14: | interface PipelineInterface extends BasePipelineInterface |
| 15: | { |
| 16: | /** |
| 17: | * Pass a payload to the pipeline |
| 18: | * |
| 19: | * Call {@see EntityPipelineInterface::run()} to run the pipeline and get |
| 20: | * the result. |
| 21: | * |
| 22: | * @template T0 |
| 23: | * @template T1 |
| 24: | * |
| 25: | * @param T0 $payload |
| 26: | * @param T1 $arg |
| 27: | * @return EntityPipelineInterface<TInput&T0,TOutput,TArgument&T1> |
| 28: | */ |
| 29: | public function send($payload, $arg = null); |
| 30: | |
| 31: | /** |
| 32: | * Pass a list of payloads to the pipeline |
| 33: | * |
| 34: | * Call {@see StreamPipelineInterface::start()} to run the pipeline with |
| 35: | * each value in `$payload` and get the results via a generator. |
| 36: | * |
| 37: | * @template T0 |
| 38: | * @template T1 |
| 39: | * |
| 40: | * @param iterable<T0> $payload |
| 41: | * @param T1 $arg |
| 42: | * @return StreamPipelineInterface<TInput&T0,TOutput,TArgument&T1> |
| 43: | */ |
| 44: | public function stream(iterable $payload, $arg = null); |
| 45: | } |
| 46: |