rename 'UpdateThread' structure to 'Updater', because it is no longer a separate thread
This commit is contained in:
30
shell/updater.sml
Normal file
30
shell/updater.sml
Normal file
@@ -0,0 +1,30 @@
|
||||
structure Updater =
|
||||
struct
|
||||
open MailboxType
|
||||
open InputMsg
|
||||
|
||||
fun sendMsg msg =
|
||||
case msg of
|
||||
DRAW msg => DrawMailbox.append msg
|
||||
| SEARCH (buffer, searchString, time) =>
|
||||
Mailbox.send (SearchMailbox.mailbox, (buffer, searchString, time))
|
||||
|
||||
fun sendMsgs msgList =
|
||||
case msgList of
|
||||
hd :: tl => let val () = sendMsg hd in sendMsgs tl end
|
||||
| [] => ()
|
||||
|
||||
fun update (app: AppType.app_type, inputMsg) =
|
||||
let
|
||||
val time = Time.now ()
|
||||
|
||||
val () = ExceptionLogger.addCommand inputMsg
|
||||
|
||||
val app = AppUpdate.update (app, inputMsg, time)
|
||||
handle e => ExceptionLogger.log e
|
||||
|
||||
val () = sendMsgs (#msgs app)
|
||||
in
|
||||
app
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user