dizzydroid commented on code in PR #35647: URL: https://github.com/apache/beam/pull/35647#discussion_r2225919766
########## website/www/site/content/en/documentation/transforms/python/other/waiton.md: ########## @@ -0,0 +1,65 @@ +--- +title: "WaitOn" +--- + +<!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +# WaitOn + +`WaitOn` delays the processing of a main `PCollection` until one or more other `PCollections` (signals) have finished processing. This is useful for enforcing ordering or dependencies between different parts of a pipeline, especially when some outputs interact with external systems (such as writing to a database). Review Comment: Fixed in [4370cc4](https://github.com/apache/beam/pull/35647/commits/4370cc4b3b2e00a73eac6e3e447eab1c6be02e71) and [3997502](https://github.com/apache/beam/pull/35647/commits/39975023bc2150646c7c8f98a109a32d0b218b34) ########## website/www/site/content/en/documentation/transforms/python/other/waiton.md: ########## @@ -0,0 +1,65 @@ +--- +title: "WaitOn" +--- + +<!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +# WaitOn + +`WaitOn` delays the processing of a main `PCollection` until one or more other `PCollections` (signals) have finished processing. This is useful for enforcing ordering or dependencies between different parts of a pipeline, especially when some outputs interact with external systems (such as writing to a database). + +When you apply `WaitOn`, the elements of the main `PCollection` will not be processed until all the specified signal `PCollections` have completed. In streaming mode, this is enforced per window: the corresponding window of each waited-on `PCollection` must be complete before elements are passed through. + +## Examples + +```python +import apache_beam as beam +from apache_beam.transforms.util import WaitOn + +# Example 1: Basic usage +with beam.Pipeline() as p: + main = p | 'CreateMain' >> beam.Create([1, 2, 3]) + side = p | 'CreateSide' >> beam.Create(['a', 'b', 'c']) Review Comment: [3997502](https://github.com/apache/beam/pull/35647/commits/39975023bc2150646c7c8f98a109a32d0b218b34) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org