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

Add Lwt_preemptive.run_in_main_no_wait #960

Merged
merged 6 commits into from
Mar 3, 2023

Conversation

kit-ty-kate
Copy link
Member

Useful if you want Lwt_preemptive.run_in_main but does not need to wait for the result of the function to finish.

@kit-ty-kate
Copy link
Member Author

Side note: personally i ended up using Lwt_unix.send_notification directly instead of using this function because the extra mutex weren't needed and made it a bit too slow and unpredictable but I feel like it might still be useful for someone someday.

@raphael-proust
Copy link
Collaborator

Thanks for the contribution!

I have just quickly read the diff and it looks good. I will test the feature soon and then merge.

@raphael-proust
Copy link
Collaborator

Considering the following changes:

  • naming it run_in_main_dont_wait to be consistent with dont_wait
  • adding an exception handler (otherwise exceptions raised by the lambda are lost)

I'll do that soon. Unless anyone have comments/remarks/etc. on the matter?

@raphael-proust
Copy link
Collaborator

I implemented the two things I mention above and also rebased

@raphael-proust
Copy link
Collaborator

@kit-ty-kate are you ok with the new interface? Does it work for your use-case?

@kit-ty-kate
Copy link
Member Author

Looks good by me.

@raphael-proust raphael-proust merged commit cc05e2b into ocsigen:master Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants