-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from GrandLTU/pipiline_skip
Fixed Tautrimas comments and added basic pipeline documentation.
- Loading branch information
Showing
7 changed files
with
77 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Pipeline | ||
======== | ||
|
||
Pipeline is used to process data with 5 events: | ||
|
||
- source | ||
- start | ||
- modify | ||
- consume | ||
- finish | ||
|
||
Pipeline starts with source event which provides all data which should be processed. | ||
Then start event is fired to indicate that items are about to come, | ||
after that pipeline iterates through all items from all sources, calling modify and consume events | ||
with each item inside ``ItemPipelineEvent``. After the iterations are finished, finish event is fired | ||
to notify that no more items will follow. | ||
|
||
Pipeline can have any number of listeners for each event but for functioning pipeline | ||
at least one source and consume listener should be provided. | ||
|
||
Listeners should listen to ongr.pipeline.<PipelineName>.<Target>.<Event> events. | ||
Example: | ||
|
||
.. code-block:: yaml | ||
test.import.modifier: | ||
class: %ongr_connections.import.modifier.class% | ||
tags: | ||
- { name: kernel.event_listener, event: ongr.pipeline.import.default.modify, method: onModify } | ||
.. | ||
Item skipping | ||
------------- | ||
If item for some reason should be skipped without stopping pipeline, ItemSkipException can be used. | ||
|
||
When modifier throws ``ItemSkipException`` pipeline catches it and sets skipException in ``ItemPipelineEvent``. | ||
If ``AbstractConsumeEventListener`` is used and ``skipException`` exception is set, ``skip`` method will be called. | ||
Otherwise ``consume`` will be invoked. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters