Commits

Sebastien Mondet  committed 14754aa

webpdb: try to add some Lwt_js.yield calls

  • Participants
  • Parent commits 37ec20a

Comments (0)

Files changed (1)

             Array.mapi Data.sphere_vertices ~f:(fun i coord ->
                 let kind_of_coord = i mod 3 in
                 (coord *. scale) +. position.(kind_of_coord)) in
+          Lwt_js.yield () |> Lwt.ignore_result;
           scaled_and_translated, Data.sphere_vertices)
     in
     debug "arrays crated";
           (* debug "Atom: %S (%s, %s, %s)" element x y z; *)
           atoms := (element, [| x;  y;  z |]) :: !atoms;
         );
+        Lwt_js.yield () |> Lwt.ignore_result;
       ) a;
     let molecule =
       ("Z", min) :: ("Z", max) :: List.rev !atoms in
       :: Renderer.sphere ~position:[| -1.;  1.; -1. |] ~scale
       :: Renderer.sphere ~position:[| -1.; -1.;  1. |] ~scale
       :: List.map molecule ~f:(fun (el, position) ->
+          Lwt_js.yield () |> Lwt.ignore_result;
           let scale =
             (try (float_of_int (int_of_char el.[0])) /. 3000. with _ -> 1.) in
           let position = [|