2025-08-07 12:20:57 +01:00
|
|
|
structure SearchThread =
|
|
|
|
|
struct
|
|
|
|
|
open CML
|
|
|
|
|
|
|
|
|
|
(* Prerequisite to sending message: move buffer to end. *)
|
|
|
|
|
fun loop (searchMailbox, inputMailbox) =
|
|
|
|
|
let
|
|
|
|
|
val (buffer, searchString) = Mailbox.recv searchMailbox
|
2025-08-07 14:40:14 +01:00
|
|
|
val searchList = SearchList.build (buffer, searchString)
|
2025-08-07 12:20:57 +01:00
|
|
|
val () = Mailbox.send (inputMailbox, InputMsg.WITH_SEARCH_LIST searchList)
|
|
|
|
|
in
|
|
|
|
|
loop (searchMailbox, inputMailbox)
|
|
|
|
|
end
|
|
|
|
|
end
|