Home > @idealeap/pipeline > Pipe
Pipe class
Represents a processing unit within a pipeline. It encapsulates a callback function and various options to control its behavior.
Signature:
typescript
export declare class Pipe<T, R>export declare class Pipe<T, R>Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(callback, options) | Constructs a new instance of the Pipe. |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| options | PipeOptions<T, R> |
Methods
| Method | Modifiers | Description |
|---|---|---|
| create(callback, options) | static | Creates and returns a new Pipe instance. This static method is designed to support chaining. |
| enableBatching() | Set batch = true for the pipe. | |
| execute(input_, context_) | Executes the pipe's main functionality, handling batching if enabled, and managing retries, errors, pre-processing, and post-processing. | |
| fromJSON(json, callback, predefinedUses) | static | Creates a new Pipe instance from a serializable options object. |
| setDescription(description) | Sets the description of the pipe. | |
| setId(id) | Sets the ID of the pipe. | |
| setRetries(retries) | Sets the number of retries for the pipe. | |
| shouldExecute(context) | Sets a dynamic dependency check function that returns a boolean to determine whether the pipe should be executed. |