File: exception.ml

package info (click to toggle)
ocaml-luv 0.5.14-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,504 kB
  • sloc: ml: 11,130; makefile: 6,223; sh: 4,592; ansic: 1,517; python: 38
file content (17 lines) | stat: -rw-r--r-- 357 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
let () =
  Luv.Async.init (fun _async -> raise Exit)
  |> ok "async init" @@ fun async ->

  Luv.Error.set_on_unhandled_exception begin function
    | Exit ->
      print_endline "Exception";
      Luv.Handle.close async ignore
    | _ ->
      ()
  end;

  Luv.Async.send async |> ok "send" @@ fun () ->

  Luv.Loop.run () |> ignore;

  print_endline "Ok"