You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a suggestion. After talking to @aantron on Discourse, I feel we should officially deprecate yield and related functions using [@@alert deprecate], in hope that one day we will merge the two pools into one.
Lwt.pause () will do the job. There are currently two pools in the codebase due to the two almost identical mechanisms, but I believe they can be safely merged once every Lwt_unix.yield () and Lwt_main.yield () is replaced by Lwt.pause ().
Lwt_main.run treats paused and yielded promises differently: it resolves paused promises twice as often as yielded promises.
This is not an intended difference, but it's a significant difference and it may be significant for several binaries.
I think that, before we release this we should:
run the tests of all the opam packages that depend on lwt with the modified lwt (I think this is possible through the opam CI in some way)
notify packages that we break or even give them some patches
advertise the possibility of the change on discuss (and maybe other channels)
Then if all of that goes well, we can release. It'll need a "breaking change" mention in the changelog.
Maybe we could leverage the opam infrastructure to test if we break some of the tests of the opam packages. I think we should do this (if possible), make upstream commits to all possibly broken packages, and we should make a special mention of this in the changelog (and advertise it in advance on discuss too).
Activity
cyberhuman commentedon May 21, 2021
How do you yield then? 🤔
favonia commentedon May 21, 2021
Lwt.pause ()will do the job. There are currently two pools in the codebase due to the two almost identical mechanisms, but I believe they can be safely merged once everyLwt_unix.yield ()andLwt_main.yield ()is replaced byLwt.pause ().aantron commentedon May 21, 2021
See
lwt/src/unix/lwt_main.mli
Lines 45 to 52 in 9cbf3a9
and https://discuss.ocaml.org/t/lwt-pause-versus-yield/7875.
raphael-proust commentedon May 25, 2021
See #784 for some earlier discussion of this.
TL;DR:
Lwt_main.runtreats paused and yielded promises differently: it resolves paused promises twice as often as yielded promises.I think that, before we release this we should:
Then if all of that goes well, we can release. It'll need a "breaking change" mention in the changelog.
Maybe we could leverage the opam infrastructure to test if we break some of the tests of the opam packages. I think we should do this (if possible), make upstream commits to all possibly broken packages, and we should make a special mention of this in the changelog (and advertise it in advance on discuss too).
favonia commentedon May 25, 2021
I just updated
CHANGESin the #858 but need help in all other actionable items.raphael-proust commentedon May 25, 2021
I'll ask some opam wizards about the general test of all dependencies.
Avoid use of deprecated `Lwt_main.yield`
Avoid use of deprecated `Lwt_main.yield`
Avoid use of deprecated `Lwt_main.yield`
favonia commentedon Nov 27, 2022
Closing this as #917 will complete every actionable items in this issue.