fix(ch17-13): shorten tx_fut sleep to fit Playground timeout (#4689)#4780
Open
Dodothereal wants to merge 1 commit into
Open
fix(ch17-13): shorten tx_fut sleep to fit Playground timeout (#4689)#4780Dodothereal wants to merge 1 commit into
Dodothereal wants to merge 1 commit into
Conversation
Fixes rust-lang#4689: the example ships with trpl::sleep(1500ms) between sends in the second producer future. That alone totals 6000ms, greater than the documented 5s JS timeout on the Rust Playground, so the page's runnable snippet times out before printing all output. Tightened the sleep to 750ms; the example still demonstrates the ordering and overlap behavior (interleaved 'received from future' / 'more messages for you'), but finishes in ~3 seconds, comfortably under the 5-second timeout window.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4689
Summary
Listing 17-13 sleeps 1500ms between sends in the second producer
future, totalling 6000ms — over the Rust Playground's 5s JS timeout,
so the runnable example on the page times out before printing all
output.
Trimmed the sleep to 750ms. The example still demonstrates the
overlap behaviour of the two producers; total runtime is ~3s.
Test plan
changed value).
AI assistance
Prepared with help from an AI coding assistant.