August'24: Kamaelia is in maintenance mode and will recieve periodic updates, about twice a year, primarily targeted around Python 3 and ecosystem compatibility. PRs are always welcome. Latest Release: 1.14.32 (2024/3/24)
The Pipeline component wires up a set of components in a linear chain (a Pipeline) and encapsulates them as a single component.
A simple pipeline of 4 components:
Pipeline(MyDataSource(...),
MyFirstStageOfProcessing(...),
MySecondStageOfProcessing(...),
MyDestination(...),
).run()
A Pipeline component gives you a way of wiring up a system of components in a chain and then encapsulating the whole as a single component. The inboxes of this component pass through to the inboxes of the first component in the Pipeline, and the outboxes of the last component pass through to the outboxes of the Pipeline component.
The components you specify are registered as children of the Pipeline component. When Pipeline is activate, all children are wired up and activated.
For the components in the Pipeline, "outbox" outboxes are wired to "inbox" inboxes, and "signal" outboxes are wired to "control" inboxes. They are wired up in the order in which you specify them - data will flow through the chain from first component to last.
The "inbox" and "control" inboxes of the Pipeline component are wired to pass-through to the "inbox" and "control" inboxes (respectively) of the first component in the Pipeline chain.
The "outbox" and "signal" outboxes of the last component in the Pipeline chain are wired to pass-through to the "outbox" and "signal" outboxes (respectively) of the Pipeline component.
During runtime, the Pipeline component monitors the child components. It will terminate if, and only if, all the child components have also terminated.
NOTE that if your child components create additional components themselves, the Pipeline component will not know about them. It only monitors the components it was originally told about.
Pipeline does not intercept any of its inboxes or outboxes. It ignores whatever traffic flows through them.
Tests passed:
Pipeline(*components) -> new Pipeline component.
Encapsulates the specified set of components and wires them up in a chain (a Pipeline) in the order you provided them.
Keyword arguments:
Warning!
You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Unplugs any children that have terminated, and returns true if there are no running child components left (ie. their microproceses have finished)
Main loop.
Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!
Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.
-- Automatic documentation generator, 05 Jun 2009 at 03:01:38 UTC/GMT