File tree Expand file tree Collapse file tree 1 file changed +2
-19
lines changed Expand file tree Collapse file tree 1 file changed +2
-19
lines changed Original file line number Diff line number Diff line change @@ -4,25 +4,8 @@ open Core_kernel
44open Async_kernel
55open Async_unix
66
7- (* register a thunk to be called at exit; log registration and execution *)
8- let register_handler ~logger ~description (f : unit -> unit ) =
9- [% log info] " Registering exit handler: $description"
10- ~metadata: [ (" description" , `String description) ] ;
11- let logging_thunk () =
12- [% log info] " Running exit handler: $description"
13- ~metadata: [ (" description" , `String description) ] ;
14- (* if there's an exception, log it, allow other handlers to run *)
15- try f ()
16- with exn ->
17- [% log info] " When running exit handler: $description, got exception $exn"
18- ~metadata:
19- [ (" description" , `String description)
20- ; (" exn" , `String (Exn. to_string exn ))
21- ]
22- in
23- Stdlib. at_exit logging_thunk
24-
25- (* register a Deferred.t thunk to be called at Async shutdown; log registration and execution *)
7+ (* register a Deferred.t thunk to be called at Async shutdown; log registration
8+ and execution *)
269let register_async_shutdown_handler ~logger ~description
2710 (f : unit -> unit Deferred.t ) =
2811 [% log debug] " Registering async shutdown handler: $description"
You can’t perform that action at this time.
0 commit comments