Skip to content

Conversation

@tiran
Copy link
Collaborator

@tiran tiran commented Sep 28, 2025

TopologicalSorter.get_ready() returns a node only once. The tracking topological sorter keeps track which nodes are marked as done. The get_available() method returns nodes again and again, until they are marked as done. The graph is active until all nodes are marked as done.

Individual nodes can be marked as exclusive nodes. get_available treats exclusive nodes special and returns:

  1. one or more non-exclusive nodes
  2. exactly one exclusive node that is a predecessor of another node
  3. exactly one exclusive node

The class uses a lock for is_activate`, get_available`, and done, so the methods can be used from threading pool and future callback.

@tiran tiran requested a review from a team as a code owner September 28, 2025 09:13
@mergify mergify bot added the ci label Sep 28, 2025
`TopologicalSorter.get_ready()` returns a node only once. The
tracking topological sorter keeps track which nodes are marked as done.
The `get_available()` method returns nodes again and again, until
they are marked as done. The graph is active until all nodes are marked
as done.

Individual nodes can be marked as exclusive nodes. ``get_available``
treats exclusive nodes special and returns:

1. one or more non-exclusive nodes
2. exactly one exclusive node that is a predecessor of another node
3. exactly one exclusive node

The class uses a lock for ``is_activate`, ``get_available`, and ``done``,
so the methods can be used from threading pool and future callback.

Signed-off-by: Christian Heimes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant