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

Lwt.npick is broken #340

Closed
aantron opened this issue Apr 13, 2017 · 1 comment
Closed

Lwt.npick is broken #340

aantron opened this issue Apr 13, 2017 · 1 comment
Labels
Milestone

Comments

@aantron
Copy link
Collaborator

aantron commented Apr 13, 2017

It seems that trying to resolve Lwt.npick, when the argument promises are initially pending, results in a promise that fails with Lwt.Canceled:

open Lwt.Infix

let () =
  let p1, r = Lwt.task () in
  let p2, _ = Lwt.task () in

  let p3 = Lwt.npick [p1; p2] in
  assert (Lwt.state p3 = Lwt.Sleep);

  Lwt.wakeup r ();

  (* Expected: *)
  (* assert (Lwt.state p3 = Lwt.Return [()]) *)

  (* Actual: *)
  assert (Lwt.state p3 = Lwt.Fail Lwt.Canceled);

(* ocamlfind opt -linkpkg -package lwt npick.ml && ./a.out *)

By comparison, if you replace npick with nchoose, you get the Expected behavior.

Since nobody has complained about this, I guess nobody is actually using npick with pending promises :)

@aantron
Copy link
Collaborator Author

aantron commented May 30, 2017

Probably best fixed after #354 is in.

@aantron aantron removed the on hold label Jul 5, 2017
@ZackC ZackC mentioned this issue Jul 14, 2017
@aantron aantron modified the milestones: 3.1.0, 3.2.0 Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant