How can I handle SIGINT in Erlang?

2019-02-12 07:59发布

I know how to create custom signal handlers in Java, Python, Ruby, Perl, and Lisp, thanks to Google and a plethora of tutorials. I can't find online how to create handlers for SIGINT, SIGTERM, HUP, etc. in Erlang.

2条回答
啃猪蹄的小仙女
2楼-- · 2019-02-12 08:47

You can not. OS signals handled exclusively by Erlang VM. I guess OS signals can be handled in a driver but it can interfere with the VM signal handler so use it on your own risk.

查看更多
姐就是有狂的资本
3楼-- · 2019-02-12 09:04

I stumbled upon this: http://erlang.org/doc/man/kernel_app.html#erl_signal_server. I have not seen it formally announced anywhere, but I might have missed the announcement.

查看更多
登录 后发表回答