otp

problems installing Erlang/OTP

天大地大妈咪最大 提交于 2019-12-12 10:58:19
问题 I'm trying to install Erlang/OTP following the documentation at http://www.erlang.org/doc/installation_guide/INSTALL.html. I'm having problems building the Erlang/OTP release. When I run make , I get: Makefile:247: /home/otp_src_17.0/make/i686-pc-linux-gnu/otp_ded.mk: No such file or directory make: *** No rule to make target `/home/amiro/otp_src_17.0/make/i686-pc-linux-gnu/otp_ded.mk'. Stop. Has anyone here encountered this kind of problem? 回答1: That error occurred while building the Erlang

Allow a supervisor child take advantage of restarts, but not kill the supervisor once it passes max restarts?

无人久伴 提交于 2019-12-11 15:35:35
问题 I have a simple_one_for_one supervisor that manages a fairly volatile set of children -- they often die due to external causes, e.g. their network conn being terminated. Erlang's supervision system is brilliant for this -- it just restarts them back up and everything rolls on. The problem occurs when one of the children has a serious problem with the connection and hits the supervisor's max restart limit, at which point the supervisor kills all children, and then kills itself. Awesome, this

Error `make` erlang after downloading latest binary

一个人想着一个人 提交于 2019-12-11 14:16:28
问题 I ran ./configure I had a couple errors that documentation couldn't be built because there was no java compiler. I didn't think that was related so I went ahead with make : What is Error 4 ? oot@marble-pyramid-1:~/download/otp_src_20.0# make MAKE depend make[1]: Entering directory `/root/download/otp_src_20.0/erts/emulator' MAKE generate make[2]: Entering directory `/root/download/otp_src_20.0/erts/emulator' GEN x86_64-unknown-linux-gnu/gen_git_version.mk GEN x86_64-unknown-linux-gnu/opt/smp

Why do we need simple_one_for_one?

巧了我就是萌 提交于 2019-12-11 10:04:18
问题 Somebody told me that simple_one_for_one is very useful for chat applications, because each chat client is a server process (gen_server). Is this right? And I wonder why do we need it? Why not create only one center server (gen_server) to handle all chat client communication? Because maybe the number of chat clients is very large so only one server couldn't handle fast, make the system slow down? I think maybe creating too many servers like simple_one_for_one may take too much system resource

Can I handle any received message in gen_fsm state callbacks?

我只是一个虾纸丫 提交于 2019-12-11 06:16:52
问题 I noticed that messages sent to the pid of a gen_fsm process are matched in the state callbacks as events. Is this just accidental or can I rely on this feature? Normally I would expect general messages sent to a gen_fsm to show up in the handle_info/3 callback and thought I would have to re-send it using gen_fsm:send_event. Does gen_fsm try to match the message first to the state callback and then allways with the handle_info/3 callback? Or only if it doesn't match a state callback clause?

ejabberd and Erlang installation with lager_transform undefined

旧城冷巷雨未停 提交于 2019-12-10 17:56:52
问题 I am new to Erlang, I have been trying to install Erlang and ejabberd on EC2 ubuntu machine, everything went well till I started compiling some external modules in ejabberd. It started throwing error "undefined parse transform 'lager_transform'". I tried everything which is as below : Did rebar get-deps, make clean, make deps, make install. After this I am able to see that lager_transform.beam is made and present in //lib/ folder. Checked rebar.config file, it had lager deps on top, which is

limitation of the reception buffer

老子叫甜甜 提交于 2019-12-10 17:44:35
问题 I established a connection with a client this way: gen_tcp:listen(1234,[binary,{packet,0},{reuseaddr,true},{active,false},{recbuf,2048}]). This code performs message processing: loop(Socket)-> inet:setops(Socket,[{active,once}], receive {tcp,Socket,Data}-> handle(Data), loop(Socket); {Pid,Cmd}-> gen_tcp:send(Socket,Cmd), loop(Socket); {tcp_close,Socket}-> % ... end. My OS is Windows. When the size of the message is 1024 bytes, I lose bytes in Data . The server sends ACK + FIN to the client. I

Cannot spawn an erlang supervisor from the shell

放肆的年华 提交于 2019-12-10 15:49:12
问题 I've implemented a gen_server and supervisor: test_server and test_sup . I want to test them from the shell/CLI. I've written their start_link functions such that their names are registered locally. I've found that I can spawn the test_server from the command line just fine, but a spawned test_sup does not allow me to interact with the server at all. For example, I can spawn a test_server by executing: 1> spawn(test_server, start_link, []). <0.39.0> 2> registered(). [...,test_server,...] I

How does Erlang sleep (at night?)

倖福魔咒の 提交于 2019-12-10 10:08:21
问题 I want to run a small clean up process every few hours on an Erlang server. I know of the timer module. I saw an example in a tutorial used chained timer:sleep commands to wait for an event that would occur multiple days later, which I found strange. I understand that Erlang process are unique compared to those in other languages, but the idea of a process/thread sleeping for days, weeks, and even months at a time seemed odd. So I set out to find out the details of what sleeping actually does

Maximum number of globally registered processes

a 夏天 提交于 2019-12-09 05:59:58
问题 Is there a limit to the number of processes that can be register globally? Or is this only limited by the memory/ max number of atoms ? Ubuntu 12.04 and Erlang R15B01. 回答1: Good question! I'd bet on the number of atoms, if you take into account the following. The Efficiency Guide has a section on system limits: Processes The maximum number of simultaneously alive Erlang processes is by default 32768. This limit can be raised up to at most 268435456 processes at startup (see documentation of