summaryrefslogtreecommitdiff
path: root/script.it/worker.ml
diff options
context:
space:
mode:
Diffstat (limited to 'script.it/worker.ml')
-rwxr-xr-xscript.it/worker.ml13
1 files changed, 6 insertions, 7 deletions
diff --git a/script.it/worker.ml b/script.it/worker.ml
index 4ea9220..00e4595 100755
--- a/script.it/worker.ml
+++ b/script.it/worker.ml
@@ -1,11 +1,10 @@
open Js_of_ocaml
-type message = [
- | `Complete of Path.Fixed.t
- | `DeletePoint of (Path.Point.t * Path.Fixed.t)
-]
+let post_message
+ : Worker_messages.from_worker -> unit
+ = Worker.post_message
-let execute (command: [> message]) =
+let execute (command: [> Worker_messages.to_worker]) =
match command with
| `Complete path ->
begin match Path.Fixed.rebuild path with
@@ -17,8 +16,8 @@ let execute (command: [> message]) =
| Some path -> Worker.post_message (`Complete path)
| None -> ()
end
- | any ->
- Worker.post_message (`Other any)
+ | _ ->
+ post_message (`Other (Js.string "Unknown message received"))
let () =
Worker.set_onmessage execute