Opentelemetry_util.AswitchAswitch for level-triggered cancellation and cleanup, atomically.
A switch can be flipped to false once, and remains off forever afterwards.
Inspired from https://ocsigen.org/lwt/5.5.0/api/Lwt_switch but thread-safe.
val pp : Stdlib.Format.formatter -> t -> unitval show : t -> stringval on_turn_off : t -> (unit -> unit) -> uniton_turn_off sw f will call f() when sw is turned off. If sw is already off then f() is called immediately.
NOTE f really should not fail, and should be as fast and light as possible.
val is_on : t -> boolval is_off : t -> boolval turn_off : trigger -> unitval turn_off' : trigger -> [ `Was_off | `Was_on ]Turn off switch, return previous state
val dummy : tAlways off switch
module Unsafe : sig ... end