Results for “Asynchronous work & URI handling”
Small, practical examples. Search by task or narrow things down below.
Run a task on an executor and close it
Java: Java 21 ExecutorService supports try-with-resources to shut down after submitted work.
Java✓ Tested
Run an event handler once
Use jQuery one for a handler that removes itself after the first event.
jQuery✓ Tested
Run cleanup when a function returns
Run cleanup when a function returns using a complete Go program with explicit sample inputs.
Go✓ Tested
Run your first Go program
Run your first Go program using a complete Go program with explicit sample inputs.
Go✓ Tested
Safely read a caught error
Check the error type before accessing its message.
unknown✓ Tested
Saturate arithmetic at the type boundary
Saturate arithmetic at the type boundary in a complete Rust program using the standard library.
Rust✓ Tested
Scan whitespace-separated tokens
Scan whitespace-separated tokens using a complete Go program with explicit sample inputs.
Go✓ Tested
Search a sorted slice
Search a sorted slice in a complete Rust program using the standard library.
Rust✓ Tested
Search a sorted vector
Use binary_search after ensuring C++ values are sorted.
C++✓ Tested
Select a range of array elements
Bash Scripts: Quote a sliced at-sign expansion to keep each selected element separate.
Bash Scripts✓ Tested
Send a JSON HTTP response
Send a JSON HTTP response using a complete Go program with explicit sample inputs.
Go✓ Tested
Send a value through a channel
Send a value through a channel in a complete Rust program using the standard library.
Rust✓ Tested