-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
Description
Currently, when a source is created, it is stored in a global list. If a program attempts to create multiple sources "on the fly" based on dynamic parameters such as:
let gen () =
let v = Atomic.make 0 in
fun () -> Atomic.fetch_and_add v
(* spawn every time a new client arrive. *)
let handler_client () =
let src = Logs.Src.create (Fmt.str "client-%08x" (gen ()) in
do_stuff ~src ()We end up with a bunch of sources that may be unused but are still kept in memory. It may be useful to either have a way to delete a source as soon as it is no longer needed (something like lwt-dllist can be useful), or to specify in the documentation that a source will remain active "forever" even if it is no longer used.