How can I handle SIGINT in Erlang?

情到浓时终转凉″ 提交于 2019-12-18 19:38:12

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/5088586/how-can-i-handle-sigint-in-erlang

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!