-
Notifications
You must be signed in to change notification settings - Fork 177
Lwt.awaken: replace wakeup and wakeup_later #1055
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
base: master
Are you sure you want to change the base?
Conversation
TODO: - documentation - tests
A bit early for a review I suppose, but the right spelling would be immediately, and you might want to use |
@MisterDA thanks! |
proposal: replace the make the type of the two functions distinct: I'm unsure about the type thing. Any comments suggestions ideas? |
proposal: make two distinct functions instead of one with parameter
The idea being: you can either prioritise the currently executing code and delay the resolving to when the scheduler runs or you can prioritise the resolving promise and you have to actuaslly pause the current promise This is a more radical change that makes the semantics clearer (one promise executes and then the scheduler kicks in, not both promise) but also backwards incompatible (you can't express |
Currently unhappy with the interface (the named parameter + constructor is too long). Alternatives:
I'm currently leaning towards this last possibility:
This makes the default case very simple and the complicated cases explicit. |
An issue with delaying the resolution of the promise is that the double-wakening exception has no place to be raised at. It happens asyncly meaning it should be handled by the async exception handler which I'm not keen to place more responsibility on. Still might be necessary. |
TODO: