Results for “Async work & status”
Small, practical examples. Search by task or narrow things down below.
Validate the number of positional arguments
Bash Scripts: Use the argument count to enforce a simple command-line contract.
Bash Scripts✓ Tested
Validate UTF-8 bytes
Validate UTF-8 bytes using a complete Go program with explicit sample inputs.
Go✓ Tested
Visit associative-array keys in a stable order
Bash Scripts: Associative arrays have no defined iteration order, so sort their keys explicitly.
Bash Scripts✓ Tested
Visit selected elements
Use jQuery each to label every item with its one-based position.
jQuery✓ Tested
Wait for a background job before reading its output
Bash Scripts: Save the job PID and wait explicitly before consuming files it produces.
Bash Scripts✓ Tested
Wait for multiple promises
Use Promise.all to collect JavaScript results in input order.
JavaScript✓ Tested
Wait for shared state with a condition variable
C++: Use a predicate so spurious wakeups cannot allow the worker to continue before the state is ready.
C++✓ Tested
Wrap a value in a distinct type
Wrap a value in a distinct type in a complete Rust program using the standard library.
Rust✓ Tested
Wrap an error with context
Wrap an error with context using a complete Go program with explicit sample inputs.
Go✓ Tested
Write a generic slice helper
Write a generic slice helper using a complete Go program with explicit sample inputs.
Go✓ Tested
Write a literal multiline block
Bash Scripts: Quoting the heredoc delimiter disables parameter and command expansion inside it.
Bash Scripts✓ Tested
Write a text file
Write a C# string to a UTF-8 file.
C#✓ Tested