-
Notifications
You must be signed in to change notification settings - Fork 177
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
Deprecate the Lwt_unix.async_method machinery and eventually remove it #572
Comments
I'm all for removing Async_switch. It was a neat trick, but is a too brittle to seriously consider keeping. But Async_none has its uses. There are not that many system call that are completely blocking for an unbounded time. Most of the things that doesn't have a usable non-blocking equivalent are disk IO, which are often fast enough not to care. In particular, if the disk cache has a good hit-rate, Async_none is faster than Async_detach. It matters when you are CPU bound rather than IO bound. By the way the only way I use it is through the environment variable. |
Thanks. I'll see about keeping |
Thanks, I would be happy with only the environment variable |
I looked in more detail, and I am now leaning towards making |
What is the current status of |
It's unchanged from before this issue was opened. |
Does that mean that I can still use |
That's what I'm leaning towards, as per the earlier comment. Can you say how or for what purpose you're using |
The attached commit makes |
Here is a description of it:
lwt/src/unix/lwt_unix.cppo.mli
Lines 68 to 87 in 0aa5063
Of the three methods,
Async_switch
, AFAICT, was only ever working on Linux, but might be broken now (#184). Since it is non-portable, marked as experimental, probably broken, and unsupported, I think we should deprecate it and eventually remove it.Of the remaining two methods,
Async_none
andAsync_detach
,Async_detach
is the reason why someone would want to use Lwt at all, overUnix
. In case we bind a system call that is not available in blocking form inUnix
, we can expose both synchronous and asynchronous bindings from Lwt. So, we should also removeAsync_none
, and thus the wholeasync_method
type.IIRC, setting the async method explicitly is basically not used in opam. I would have to look again to see what the exact impact is.
The text was updated successfully, but these errors were encountered: