You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get started with Hyperbee.Pipeline, refer to the documentation for detailed instructions and examples.
48
43
49
-
The `Hook` and `HookAsync` methods allow you to add a hook that is called for every statement in the pipeline. This hook takes the current context, the current argument, and a delegate to the next part of the pipeline. It can manipulate the argument before and after calling the next part of the pipeline.
The `Wrap` and `WrapAsync` method allows you to wrap a part of the pipeline. This is useful when you want to apply a transformation to only a part of the pipeline.
69
-
70
-
Here’s an example of how to use `WrapAsync`:
52
+
Pipelines are built using `PipelineFactory`. Once built, a pipeline is just an async function that takes a `PipelineContext` and
53
+
an optional input value as parameters, and returns a result.
The `PipelineFactory` library provides a variety of helper methods that allow you to customize the behavior of your pipelines. These methods provide powerful functionality for manipulating data as it passes through the pipeline.
116
-
117
-
### Reduce
118
-
119
-
The `Reduce` and `ReduceAsync` methods allow you to reduce a sequence of elements to a single value. You can specify a reducer function that defines how the elements should be combined, and a builder function that creates the pipeline for processing the elements.
120
-
121
-
### WaitAll
122
-
123
-
The `WaitAll` method allows you to wait for all pipelines to complete before continuing. You can specify a set of builders that create the pipelines to wait for, a reducer function that combines the results of the pipelines.
The `PipeIf` method allows you to conditionally add a step to the pipeline. You can specify a condition function that determines whether the step should be added, a builder function that creates the step, and an optional flag indicating whether middleware should be inherited.
92
+
## Pipeline of Pipelines
147
93
148
-
### ForEach and ForEachAsync
94
+
The `PipelineFactory` library allows you to use pipelines together. Since pipelines are just functions, they can be used
95
+
as input to other pipelines. This allows you to create complex data processing flows by reusing and chaining together
96
+
multiple pipelines.
149
97
150
-
The `ForEach` and `ForEachAsync` methods allow you to apply a pipeline to each element in a sequence. You can specify a builder function that creates the pipeline for processing the elements.
98
+
Here's an example of how to use pipelines together:
151
99
152
100
```csharp
153
-
varcount=0;
154
-
155
-
varcommand=PipelineFactory
101
+
varpipeline2=PipelineFactory
156
102
.Start<string>()
157
-
.Pipe( ( ctx, arg ) =>arg.Split( ' ' ) )
158
-
.ForEach<string>( builder=>builder
159
-
.Pipe( ( ctx, arg ) =>count+=10 )
160
-
)
161
-
.Pipe( ( ctx, arg ) =>count+=5 )
103
+
.Pipe( ( ctx, arg ) =>$"{arg} again!" )
162
104
.Build();
163
105
164
-
awaitcommand( newPipelineContext(), "e f" );
165
-
166
-
Assert.AreEqual( count, 25 );
167
-
```
168
-
169
-
### Call and CallAsync
170
-
171
-
The `Call` and `CallAsync` methods allow you to add a procedure to the pipeline. You can think of these as `Action<T>` and `Pipe` like `Func<T>`.
172
-
173
-
In this example notice that `arg + 9` is not returned from the use of `Call`
The `PipelineFactory` library allows you to chain pipelines together. Since pipelines are just functions, they can be used as input to other pipelines. This allows you to create complex data processing flows by reusing and chaining together multiple pipelines.
119
+
The `PipelineFactory` library provides a variety of builders that allow you to customize the behavior of your pipelines.
120
+
These methods provide powerful functionality for manipulating data as it passes through the pipeline.
198
121
199
-
Here's an example of how to chain pipelines together:
0 commit comments