Skip to content

Commit

Permalink
add Moonpool_fiber.spawn_top_ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Sep 5, 2024
1 parent 9623e2d commit 7841273
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/fib/fiber.ml
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ let spawn ?on ?(protect = true) f : _ t =
child

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 =
match get_cur_exn () with
Expand Down
4 changes: 4 additions & 0 deletions src/fib/fiber.mli
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,7 @@ val spawn_ignore : ?protect:bool -> (unit -> _) -> unit
(** [spawn_ignore f] is [ignore (spawn f)].
The fiber will still affect termination of the parent, ie. the
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 *)

0 comments on commit 7841273

Please sign in to comment.