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