package com.it_jaros.jscanner.scan.engine; /** * A sealed interface representing the three possible outcomes of a CompletionService * poll operation: successful result, task failure, or not ready yet. * Makes error handling explicit — Failure and Unavailable are distinct and compile-time * required to handle via exhaustiveness checking in switch statements. */ public sealed interface PollState { record Success(T value) implements PollState {} record Failure(Throwable error) implements PollState {} record Unavailable() implements PollState {} }