Skip to content

fix(ch17-13): shorten tx_fut sleep to fit Playground timeout (#4689)#4780

Open
Dodothereal wants to merge 1 commit into
rust-lang:mainfrom
Dodothereal:fix/issue-4689-playground-timeout-17-13
Open

fix(ch17-13): shorten tx_fut sleep to fit Playground timeout (#4689)#4780
Dodothereal wants to merge 1 commit into
rust-lang:mainfrom
Dodothereal:fix/issue-4689-playground-timeout-17-13

Conversation

@Dodothereal

Copy link
Copy Markdown

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

  • git diff: one-file, one-line change.
  • The example remains compilable (sleep duration is the only
    changed value).

AI assistance

Prepared with help from an AI coding assistant.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playground timeout on listing 17-13

1 participant