Module Lwt_gc
Interaction with the garbage collector
val finalise : ('a -> unit Lwt.t) -> 'a -> unitfinalise f xensuresf xis evaluated afterxhas been garbage collected. Iff xyields, then Lwt will wait for its termination at the end of the program.Note that
f xis not called at garbage collection time, but later in the main loop.
val finalise_or_exit : ('a -> unit Lwt.t) -> 'a -> unitfinalise_or_exit f xcallf xwhenxis garbage collected or (exclusively) when the program exits.