mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
change signature of with_setup
This commit is contained in:
parent
a768c55eac
commit
b03ff26ba6
3 changed files with 5 additions and 3 deletions
|
|
@ -471,6 +471,6 @@ let setup ?(config=Config.make()) () =
|
|||
let cleanup = setup_ ~config () in
|
||||
at_exit cleanup
|
||||
|
||||
let with_setup ?(config=Config.make()) f =
|
||||
let with_setup ?(config=Config.make()) () f =
|
||||
let cleanup = setup_ ~config () in
|
||||
Fun.protect ~finally:cleanup f
|
||||
|
|
|
|||
|
|
@ -64,4 +64,6 @@ val setup : ?config:Config.t -> unit -> unit
|
|||
(** Setup endpoint. This modifies {!Opentelemetry.Collector.backend}.
|
||||
@param config configuration to use *)
|
||||
|
||||
val with_setup : ?config:Config.t -> (unit -> 'a) -> 'a
|
||||
val with_setup : ?config:Config.t -> unit -> (unit -> 'a) -> 'a
|
||||
(** [with_setup () f] is like [setup(); f()] but takes care of cleaning up
|
||||
after [f()] returns. *)
|
||||
|
|
|
|||
|
|
@ -82,4 +82,4 @@ let () =
|
|||
Format.printf "@[<2>sleep outer: %.3fs,@ sleep inner: %.3fs,@ config: %a@]@."
|
||||
!sleep_outer !sleep_inner Opentelemetry_client_ocurl.Config.pp config;
|
||||
|
||||
Opentelemetry_client_ocurl.with_setup ~config run
|
||||
Opentelemetry_client_ocurl.with_setup ~config () run
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue