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 {
// 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.
// The 'sources' parameter represents an async-stream of async-streams.
// The resulting generator merges the results from each of the streams
......@@ -37,17 +37,16 @@ namespace coro {
// been reached and the ends of all of the input streams it produced have been
// reached.
//
// On exception, cancellation, or output stream destruction: cancels remaining
// input streams and 'sources', discards any remaining values, and produces an
// exception (if an input stream produced an exception) or end-of-stream
// (if next() call was cancelled).
// On exception or cancellation, cancels remaining input streams and 'sources',
// discards any remaining values, and produces an exception (if an input stream
// produced an exception) or end-of-stream (if next() call was cancelled).
//
// Structured concurrency: if the output stream produced an empty value
// (end-of-stream) or an exception, it's guaranteed that 'sources' and all input
// generators have been destroyed.
// If the output stream is destroyed before reaching end-of-stream or exception,
// the remaining input generators are cancelled and detached; beware of
// use-after-free.
// If the output stream is destroyed early (before reaching end-of-stream or
// exception), the remaining input generators are cancelled and detached; beware
// of use-after-free.
//
// Normally cancelling output stream's next() call cancels the stream, discards
// 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