-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add try_put_and_wait documentation #1514
base: master
Are you sure you want to change the base?
Conversation
*********** | ||
|
||
This feature adds a new ``try_put_and_wait`` interface to the receiving nodes in the Flow Graph. | ||
This function allows to wait until completion of single message, submitted to ``try_put_and_wait`` as an input by the Flow Graph in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest, "This function puts a message as an input into a Flow Graph and then waits until all work related to that input is complete."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a second sentence, "try_put_and_wait may reduce latency compared to calling graph::wait_for_all since graph::wait_for_all waits for all work, including work unrelated to the input message, to complete."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the wording for "indefinite waiting" should be used consistently. So maybe double check that don't match that language are intentional, for example check for "blocking" and "infinite waiting".
*********** | ||
|
||
This feature adds a new ``try_put_and_wait`` interface to the receiving nodes in the Flow Graph. | ||
This function allows to wait until completion of single message, submitted to ``try_put_and_wait`` as an input by the Flow Graph in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a second sentence, "try_put_and_wait may reduce latency compared to calling graph::wait_for_all since graph::wait_for_all waits for all work, including work unrelated to the input message, to complete."
``node.try_put_and_wait(msg)`` performs ``node.try_put(msg)`` on the node and waits until the work on ``msg`` is completed. | ||
Therefore, the following conditions are true: | ||
|
||
* Any task initiated by any node in the Flow Graph that involves on working with ``msg`` or any other intermediate result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Any task initiated by any node in the Flow Graph that involves on working with ``msg`` or any other intermediate result | |
* Any task initiated by any node in the Flow Graph that involves working with ``msg`` or any other intermediate result |
|
||
* Any task initiated by any node in the Flow Graph that involves on working with ``msg`` or any other intermediate result | ||
computed from ``msg`` is completed. | ||
* Any intermediate result computed from ``msg`` is retrieved from any buffer in the graph. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Any intermediate result computed from ``msg`` is retrieved from any buffer in the graph. | |
* No intermediate results computed from ``msg`` remain in any buffers in the graph. |
.. caution:: | ||
|
||
To prevent ``try_put_and_wait`` calls from infinite blocking, avoid using buffering nodes at the end of the Flow Graph since the final result | ||
would not be retrieved by the Flow Graph. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would not be retrieved by the Flow Graph. | |
will not be automatically consumed by the Flow Graph. |
|
||
.. caution:: | ||
|
||
To prevent ``try_put_and_wait`` calls from infinite blocking, avoid using buffering nodes at the end of the Flow Graph since the final result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent ``try_put_and_wait`` calls from infinite blocking, avoid using buffering nodes at the end of the Flow Graph since the final result | |
To prevent ``try_put_and_wait`` calls from infinite waiting, avoid using buffering nodes at the end of the Flow Graph since the final result |
}); | ||
} | ||
|
||
Each iteration of ``parallel_for`` submits a part of work into the Flow Graph. After returning from ``try_put_and_wait(input)``, it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each iteration of ``parallel_for`` submits a part of work into the Flow Graph. After returning from ``try_put_and_wait(input)``, it is | |
Each iteration of ``parallel_for`` submits an input into the Flow Graph. After returning from ``try_put_and_wait(input)``, it is |
Description
Add reference page about Flow Graph try_put_and_wait feature
Fixes # - issue number(s) if exists
Type of change
Choose one or multiple, leave empty if none of the other choices apply
Add a respective label(s) to PR if you have permissions
Tests
Documentation
Breaks backward compatibility
Notify the following users
List users with
@
to send notificationsOther information