Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Revamp ray core design patterns doc [15/n]: actor sync #29773

Merged
merged 5 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions doc/source/ray-core/actors/patterns/actor-sync.rst

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/ray-core/actors/patterns/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ You may also be interested in visiting the design patterns section for :ref:`tas
:maxdepth: -1

tree-of-actors
actor-sync
concurrent-operations-async-actor
overlapping-computation-communication
fault-tolerance-actor-checkpointing
16 changes: 16 additions & 0 deletions doc/source/ray-core/patterns/actor-sync.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Pattern: Using an actor to synchronize other tasks and actors
=============================================================

When you have multiple tasks that need to wait on some condition or otherwise
need to synchronize across tasks & actors on a cluster, you can use a central
actor to coordinate among them.

Example use case
----------------

You can use an actor to implement a distributed ``asyncio.Event`` that multiple tasks can wait on.

Code example
------------

.. literalinclude:: ../doc_code/actor-sync.py
1 change: 1 addition & 0 deletions doc/source/ray-core/patterns/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This section is a collection of common design patterns and anti-patterns for wri
generators
limit-pending-tasks
limit-running-tasks
actor-sync
ray-get-loop
unnecessary-ray-get
ray-get-submission-order
Expand Down