From bffdc005275bf74cde864dabcfafec497dcf0013 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 14 Nov 2025 17:01:21 -0500 Subject: Implement concurrent analysis with [+] state indicator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add Analyzing state to BuildState enum - Refactor from sequential foldM analyze to concurrent analyzeAll - Initialize all lines with [+] during analysis phase - Update to [...] (Pending) after each analysis completes - Uses mapConcurrentlyBounded with concurrency of 8 for analysis - Remove Log.info from analyzeOne (now handled by line state) - Analysis now runs in parallel, improving efficiency - Flow: [+] analyzing → [...] pending → [~] building → [✓]/[x] complete --- Omni/Log/Concurrent.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Omni/Log/Concurrent.hs') diff --git a/Omni/Log/Concurrent.hs b/Omni/Log/Concurrent.hs index b064190..1a82507 100644 --- a/Omni/Log/Concurrent.hs +++ b/Omni/Log/Concurrent.hs @@ -26,7 +26,7 @@ import qualified System.Environment as Env import qualified System.IO as IO import System.IO.Unsafe (unsafePerformIO) -data BuildState = Pending | Building | Success | Failed +data BuildState = Analyzing | Pending | Building | Success | Failed deriving (Eq, Show) data LineManager = LineManager @@ -92,7 +92,7 @@ initializeLines LineManager {..} = ANSI.hSetCursorColumn IO.stderr 0 ANSI.hClearLine IO.stderr let nsText = Text.pack (Namespace.toPath ns) - IO.hPutStrLn IO.stderr (Text.unpack <| "[…] " <> nsText) + IO.hPutStrLn IO.stderr (Text.unpack <| "[+] " <> nsText) IO.hFlush IO.stderr updateLine :: Namespace -> Text -> IO () @@ -146,6 +146,8 @@ updateLineState ns buildState = do Rainbow.hPutChunks IO.stderr [fore green <| chunk <| "[✓] " <> nsText] Failed -> Rainbow.hPutChunks IO.stderr [fore red <| chunk <| "[x] " <> nsText] + Analyzing -> + IO.hPutStr IO.stderr (Text.unpack <| "[+] " <> nsText) Pending -> IO.hPutStr IO.stderr (Text.unpack <| "[…] " <> nsText) Building -> -- cgit v1.2.3