Commit dd5e8b4f authored by Mike Kolupaev's avatar Mike Kolupaev Committed by Facebook GitHub Bot

Clarify comment for coro::merge()

Summary: Based on scsiguy's feedback. Probably it can be made shorter and clearer still, feel free to propose more changes.

Reviewed By: scsiguy

Differential Revision: D33591287

fbshipit-source-id: e0bf85ebfd98d7032ddbd54c69c52b33525a62c7
parent 9d608677
...@@ -26,7 +26,7 @@ namespace coro { ...@@ -26,7 +26,7 @@ namespace coro {
// Merge the results of a number of input streams. // Merge the results of a number of input streams.
// //
// The 'executor' parameter represents specifies the execution context to // The 'executor' parameter specifies the execution context to
// be used for awaiting each value from the sources. // be used for awaiting each value from the sources.
// The 'sources' parameter represents an async-stream of async-streams. // The 'sources' parameter represents an async-stream of async-streams.
// The resulting generator merges the results from each of the streams // The resulting generator merges the results from each of the streams
...@@ -37,17 +37,16 @@ namespace coro { ...@@ -37,17 +37,16 @@ namespace coro {
// been reached and the ends of all of the input streams it produced have been // been reached and the ends of all of the input streams it produced have been
// reached. // reached.
// //
// On exception, cancellation, or output stream destruction: cancels remaining // On exception or cancellation, cancels remaining input streams and 'sources',
// input streams and 'sources', discards any remaining values, and produces an // discards any remaining values, and produces an exception (if an input stream
// exception (if an input stream produced an exception) or end-of-stream // produced an exception) or end-of-stream (if next() call was cancelled).
// (if next() call was cancelled).
// //
// Structured concurrency: if the output stream produced an empty value // Structured concurrency: if the output stream produced an empty value
// (end-of-stream) or an exception, it's guaranteed that 'sources' and all input // (end-of-stream) or an exception, it's guaranteed that 'sources' and all input
// generators have been destroyed. // generators have been destroyed.
// If the output stream is destroyed before reaching end-of-stream or exception, // If the output stream is destroyed early (before reaching end-of-stream or
// the remaining input generators are cancelled and detached; beware of // exception), the remaining input generators are cancelled and detached; beware
// use-after-free. // of use-after-free.
// //
// Normally cancelling output stream's next() call cancels the stream, discards // Normally cancelling output stream's next() call cancels the stream, discards
// any remaining values, and returns an end-of-stream. But there are caveats: // any remaining values, and returns an end-of-stream. But there are caveats:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment