-
Notifications
You must be signed in to change notification settings - Fork 82
Signals abstraction #321
Description
As discussed in #301 we might need to abstract Signals.
I've got a working prototype that works on uring and libuv but we have to define some things before I go forward.
1. Do we want to export more signals, less or the same as Sys ?
Sys is a bit conservative and I think we should export more, for example it misses SIGWINCH and SIGINFO (linux doesn't have this but it's popular in Unix).
2. Do we want to restrict what we export ?
Like type signum = Sigint | Sigwhatever, or we just keep accepting an int and if the user wants to use whatever other signal he has, he can.
I think we should keep taking an int, but do some discovery ourselves (for the value of SIGWINCH for example) and export that as a
val sigwinch : int
Worth noting that the default ocaml signal interface accepts arbitrary integers so that would be no issue, also not an issue with Luv.
3. What do we do with signals that are not supported ?
Do we want to fail hard, fail silently or give it a "button" to control the behavior, this is likely very relevant for windows as they have only a small set of signals.