Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn about both operations succeeding in Fiber.first #358

Merged
merged 1 commit into from
Oct 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib_eio/core/eio__core.mli
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ module Fiber : sig

As with [both], [f] runs immediately and [g] is scheduled next, ahead of any other queued work.

If both fibers fail, {!Exn.combine} is used to combine the exceptions. *)
If both fibers fail, {!Exn.combine} is used to combine the exceptions.

Warning: it is always possible that {i both} operations will succeed (and one result will be thrown away).
This is because there is a period of time after the first operation succeeds,
but before its fiber finishes, during which the other operation may also succeed. *)

val any : (unit -> 'a) list -> 'a
(** [any fs] is like [first], but for any number of fibers.
Expand Down