lwt
lwt copied to clipboard
Add Lwt_preemptive.run_in_main_no_wait
Useful if you want Lwt_preemptive.run_in_main
but does not need to wait for the result of the function to finish.
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.
Thanks for the contribution!
I have just quickly read the diff and it looks good. I will test the feature soon and then merge.
Considering the following changes:
- naming it
run_in_main_dont_wait
to be consistent withdont_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?
I implemented the two things I mention above and also rebased
@kit-ty-kate are you ok with the new interface? Does it work for your use-case?
Looks good by me.