use concurrency for rebuilding search list after deletion so we don't block main thread on very, very large files

This commit is contained in:
2025-08-07 12:20:57 +01:00
parent fab8cfcf20
commit 704854c80f
10 changed files with 220 additions and 137 deletions

14
shell/search-thread.sml Normal file
View File

@@ -0,0 +1,14 @@
structure SearchThread =
struct
open CML
(* Prerequisite to sending message: move buffer to end. *)
fun loop (searchMailbox, inputMailbox) =
let
val (buffer, searchString) = Mailbox.recv searchMailbox
val (_, searchList) = SearchList.build (buffer, searchString)
val () = Mailbox.send (inputMailbox, InputMsg.WITH_SEARCH_LIST searchList)
in
loop (searchMailbox, inputMailbox)
end
end