Cancellable Task Runner With Cleanup
A cancellable task runner that stops starting new work on abort and always runs registered cleanup, even when a task throws mid-flight.
Survive flaky dependencies: dedupe in-flight work, cancel cleanly, and classify what is worth retrying.
A cancellable task runner that stops starting new work on abort and always runs registered cleanup, even when a task throws mid-flight.
A shutdown coordinator that stops accepting work, waits for in-flight tasks to settle, and force-cancels whatever remains after a deadline.
A deadline helper that derives per-step timeouts from one shared budget so a slow first step cannot make later steps exceed the total.
An error classifier that maps thrown errors to retryable or fatal decisions with an explicit reason, so retry policy never guesses from message text.
A single-flight map that collapses concurrent identical calls into one in-flight request and shares its result with every caller.
Demonstrates proper exit code handling, error checking, set options for fail-safe behavior, and custom exit codes for script error reporting.
Handles Unix signals in Bash scripts using trap, kill, and wait for graceful shutdown, timeout enforcement, and inter-process communication.
Sets up trap handlers for signals like EXIT, INT, TERM, and ERR to ensure cleanup, graceful shutdown, and error recovery in Bash scripts.
Defines a custom exception hierarchy with domain-specific exceptions, demonstrating proper exception chaining, message formatting, and multi-catch handling.
Uses ScheduledExecutorService to run delayed and periodic tasks, demonstrating fixed-rate and fixed-delay scheduling with proper shutdown handling.
Demonstrates using Optional to handle potentially absent values safely, with map, flatMap, filter, orElse, and ifPresent operations to avoid NullPointerExcep...
Creates a fixed thread pool to execute multiple tasks concurrently, demonstrating proper resource management with try-with-resources and shutdown handling.