add Moonpool_fiber.spawn_top_ignore

This commit is contained in:
Simon Cruanes 2024-09-05 13:25:25 -04:00
parent 9623e2d4b6
commit 784127316d
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 5 additions and 0 deletions

View file

@ -303,6 +303,7 @@ let spawn ?on ?(protect = true) f : _ t =
child child
let[@inline] spawn_ignore ?protect f : unit = ignore (spawn ?protect f : _ t) let[@inline] spawn_ignore ?protect f : unit = ignore (spawn ?protect f : _ t)
let[@inline] spawn_top_ignore ~on f : unit = ignore (spawn_top ~on f : _ t)
let[@inline] self () : any = let[@inline] self () : any =
match get_cur_exn () with match get_cur_exn () with

View file

@ -147,3 +147,7 @@ val spawn_ignore : ?protect:bool -> (unit -> _) -> unit
(** [spawn_ignore f] is [ignore (spawn f)]. (** [spawn_ignore f] is [ignore (spawn f)].
The fiber will still affect termination of the parent, ie. the The fiber will still affect termination of the parent, ie. the
parent will exit only after this new fiber exits. *) parent will exit only after this new fiber exits. *)
val spawn_top_ignore : on:Runner.t -> (unit -> _) -> unit
(** Like {!spawn_top} but ignores the result.
@since NEXT_RELEASE *)