▸case-01 My Rust application needs to query three HTTP endpoints concurrently, apply individual timeouts, and aggregate the responses safely without letting one failure silent-drop the others. Provide a code template for this concurrent fetch pattern and include a bulleted list explaining the async error handling strategy. | pass→pass | 19,870 | 17,407 | -12% | 1 | 1 | 0% | 3,147 | 2,661 | -15% | 0 | 0 | — |
▸case-02 I am experiencing memory spikes in my Tokio worker service because incoming event batches are arriving faster than my async pipeline can process them. Output a refactored Rust code snippet demonstrating proper stream processing along with a brief summary of how backpressure should be managed in this setup. | pass→pass | 15,629 | 12,646 | -19% | 1 | 1 | 0% | 2,714 | 2,236 | -18% | 0 | 0 | — |
▸case-03 I need to run a background task in Rust that periodically flushes cached logs to disk, but I want to guarantee that when the main application receives a graceful shutdown signal, the flusher completes its final write before terminating. Provide a complete async task pattern with shutdown signaling. | fail→fail | 25,049 | 20,574 | -18% | 1 | 1 | 0% | 4,772 | 4,198 | -12% | 0 | 0 | — |
▸case-04 In an async Rust log aggregation service, producers generate log entries rapidly while a single disk-writing consumer writes them out. Developers are tempted to use an unbounded channel to prevent producer calls from blocking. Provide a recommended channel implementation that prevents unbounded memory growth. | fail→pass | 14,923 | 13,838 | -7% | 1 | 1 | 0% | 2,570 | 2,782 | +8% | 0 | 0 | — |
▸case-05 A web crawler in Rust needs to spawn tens of thousands of independent HTTP fetch tasks dynamically while tracking completion order and collecting results without spawning unbounded task handles into memory. Outline the concurrency primitive to manage these dynamic tasks. | pass→pass | 16,939 | 14,414 | -15% | 1 | 1 | 0% | 2,908 | 2,598 | -11% | 0 | 0 | — |
▸case-06 A network handler loop uses tokio::select! to listen for incoming TCP data on a socket and a cancellation signal on a channel simultaneously. The developer notices that when cancellation occurs, partial packet reads are lost. Explain how to handle cancel safety in this loop and provide a safe implementation. | pass→pass | 22,680 | 19,487 | -14% | 1 | 1 | 0% | 3,571 | 3,935 | +10% | 0 | 0 | — |
▸case-07 In a Rust Tokio application, multiple async tasks need to update a shared in-memory hash map. Developers often default to tokio::sync::Mutex everywhere. Provide code showing when std::sync::Mutex is preferable over tokio::sync::Mutex across await points. | pass→pass | 14,962 | 20,085 | +34% | 1 | 1 | 0% | 2,662 | 3,393 | +27% | 0 | 0 | — |
▸case-08 A telemetry service receives a continuous stream of metrics from a socket and needs to filter out debug messages, batch remaining metrics into groups of 100, and send them to a database asynchronously. Show how to implement this stream processing pattern. | fail→pass | 21,558 | 24,780 | +15% | 1 | 1 | 0% | 4,231 | 4,168 | -1% | 0 | 0 | — |
▸case-09 An async gRPC client call in Rust occasionally hangs indefinitely due to network drops. Show how to wrap the async client request with a timeout mechanism that yields an error if the request takes longer than 5 seconds. | pass→pass | 12,637 | 8,914 | -29% | 1 | 1 | 0% | 2,377 | 1,843 | -22% | 0 | 0 | — |
▸case-10 An actor pattern in Rust needs an async task to send a request to a dedicated state manager worker and wait for a single response back from the worker without polling. Provide the async channel setup for this request-response pattern. | pass→pass | 16,775 | 12,420 | -26% | 1 | 1 | 0% | 2,720 | 2,675 | -2% | 0 | 0 | — |
▸case-11 A multi-client WebSocket server in Rust needs to broadcast system alerts from a central event bus to all connected client tasks simultaneously. Show how to set up the broadcast communication primitive. | pass→pass | 14,529 | 14,493 | -0% | 1 | 1 | 0% | 2,809 | 2,280 | -19% | 0 | 0 | — |
▸case-12 A microservice in Rust needs to distribute configuration updates to dozens of worker tasks, where workers only care about the latest configuration value and can skip intermediate updates if overwhelmed. Show the optimal Tokio channel choice. | pass→pass | 12,698 | 13,117 | +3% | 1 | 1 | 0% | 2,359 | 2,504 | +6% | 0 | 0 | — |
▸case-13 A high-throughput logging system in Rust writes raw binary payloads to a log file asynchronously. Developers write individual small byte vectors directly to tokio::fs::File, causing severe I/O degradation. Show how to optimize this async file write pattern. | fail→pass | 25,560 | 14,957 | -41% | 1 | 1 | 0% | 3,996 | 3,066 | -23% | 0 | 0 | — |
▸case-14 An async Rust web service receives a request containing an encrypted blob and must perform heavy CPU-bound password hashing using Argon2 before responding. Show how to run this CPU-bound operation without starving the Tokio async worker threads. | pass→pass | 13,786 | 14,078 | +2% | 1 | 1 | 0% | 2,572 | 2,428 | -6% | 0 | 0 | — |
▸case-15 An async worker pool makes outgoing HTTP requests to an external API that strictly limits client concurrency to 10 simultaneous connections. Show how to restrict concurrent requests using Tokio primitives. | pass→pass | 13,097 | 10,957 | -16% | 1 | 1 | 0% | 2,509 | 2,237 | -11% | 0 | 0 | — |
▸case-16 An async Rust network service combines I/O errors, JSON parsing errors, and request timeout errors. Developers wrap everything in Box<dyn std::error::Error>. Show how to structure a domain-specific async error type using standard crate patterns. | pass→pass | 16,484 | 15,352 | -7% | 1 | 1 | 0% | 2,684 | 3,238 | +21% | 0 | 0 | — |
▸case-17 A Rust application defines a storage backend trait where methods like get and put perform async network operations. Show how to define and implement async trait methods in Rust. | pass→pass | 15,792 | 15,932 | +1% | 1 | 1 | 0% | 3,115 | 3,503 | +12% | 0 | 0 | — |
▸case-18 An async Rust service spawns several sub-tasks to process user requests, but log messages across spawned tasks lose their correlation IDs. Show how to instrument async tasks with tracing spans so context flows into spawned tasks. | pass→pass | 28,633 | 15,074 | -47% | 1 | 1 | 0% | 2,717 | 2,582 | -5% | 0 | 0 | — |
▸case-19 A Kubernetes microservice written in Rust needs to listen for SIGINT and SIGTERM OS signals to initiate a graceful shutdown sequence. Show how to catch these signals in a Tokio application. | pass→pass | 16,843 | 9,770 | -42% | 1 | 1 | 0% | 2,690 | 2,144 | -20% | 0 | 0 | — |
▸case-20 An async Rust service executes three independent async database queries concurrently. If any query fails, the combined operation should immediately fail and cancel the remaining queries. Demonstrate the concurrency macro for short-circuiting on failure. | pass→pass | 10,770 | 9,310 | -14% | 1 | 1 | 0% | 2,205 | 2,146 | -3% | 0 | 0 | — |
▸case-21 You are writing unit tests for an async TCP frame parser in Rust and need to simulate socket I/O in memory without opening real network sockets. Show how to create an in-memory async byte stream for testing. | pass→pass | 13,608 | 11,418 | -16% | 1 | 1 | 0% | 2,623 | 2,574 | -2% | 0 | 0 | — |
▸case-22 I need to process a heavy array of 10 million floating point numbers in Rust by calculating their square roots in parallel on a multi-core CPU without using an async runtime. Provide a synchronous parallel processing snippet using Rayon. | pass→pass | 7,455 | 7,090 | -5% | 1 | 1 | 0% | 1,401 | 1,594 | +14% | 0 | 0 | — |
▸case-23 I have a synchronous Rust CLI tool that needs to spawn two worker threads to process two local text files concurrently using std::thread::scope without any async runtime dependencies. Provide the synchronous thread implementation. | pass→pass | 18,014 | 12,198 | -32% | 1 | 1 | 0% | 3,080 | 2,076 | -33% | 0 | 0 | — |
▸case-24 A synchronous Rust command-line tool needs to read a configuration file line-by-line using standard std::fs::File and std::io::BufReader without any async dependencies or event loops. Show the synchronous file reading code. | pass→pass | 6,278 | 6,235 | -1% | 1 | 1 | 0% | 1,018 | 1,461 | +44% | 0 | 0 | — |