Configuration.pipeline()
Description
Creates a sub-pipeline layout.
A sub-pipeline has the following input/output:
- INPUT - Any types of Events.
- OUTPUT - Any types of Events.
Sub-pipelines are pipelines that can be created from other pipelines during the processing of a stream. They can be created by referring to their names. Pipeline layout names are unique within a module, but can be duplicated across different modules. Therefore, to refer to a pipeline layout inside the current module, only its name is necessary, but to refer to a pipeline layout in a different module (as in the case of Configuration.use()), the module's filename is also needed.
After calling this method on a Configuration, the newly created pipeline layout would become current. Any filter-creating methods called after this point would append filters to that pipeline layout, until another pipeline-layout-creating method is called.
Syntax
pipy().pipeline().filterA().filterB()// ...pipy().pipeline(name).filterA().filterB()// ...
Parameters
pipeline(name?)
The name of the sub-pipeline, or the module entry pipeline layout is created if the name is absent.
The same Configuration object.
Example
pipy()// Start listening on 8080.listen(8080).fork('send-and-forget') // Clone the TCP stream to a new 'send-and-forget' sub-pipeline.serveHTTP(new Message('Hello!') // Respond with a hello)// Defines a sub-pipeline layout named 'send-and-forget'.pipeline('send-and-forget').connect('localhost:8000') // Send the stream to a remote host