Skip to content

Commit

Permalink
Update website/www/site/content/en/documentation/programming-guide.md
Browse files Browse the repository at this point in the history
Co-authored-by: tvalentyn <[email protected]>
  • Loading branch information
liferoad and tvalentyn authored Oct 13, 2023
1 parent e2ba8a8 commit 6b6977d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ Here is a sequence diagram that shows the lifecycle of the DoFn during
isn't guaranteed.
2. the number of DoFn instances created at runtime is runner-dependent.
3. for the Python SDK, the pipeline contents such as DoFn user code,
is [serialized into a bytecode](https://beam.apache.org/documentation/sdks/python-pipeline-dependencies/#pickling-and-managing-the-main-session). Use [this module](https://beam.apache.org/releases/pydoc/current/apache_beam.utils.shared.html) to manage a single instance of a DoFn shared by multiple threads within the same process.
is [serialized into a bytecode](https://beam.apache.org/documentation/sdks/python-pipeline-dependencies/#pickling-and-managing-the-main-session). Therefore, `DoFn`s should not reference objects that are not serializable, such as locks. To manage a single instance of an object across multiple `DoFn` instances in the same process, use utilities in the [shared.py](https://beam.apache.org/releases/pydoc/current/apache_beam.utils.shared.html) module.

<!-- The source for the sequence diagram can be found in the SVG resource. -->
![This is a sequence diagram that shows the lifecycle of the DoFn](/images/dofn-sequence-diagram.svg)
Expand Down

0 comments on commit 6b6977d

Please sign in to comment.