Erlang is a general-purpose, garbage-collected programming language and runtime environment, with built-in support for concurrency, distribution and fault tolerance.
Erlang is a general-purpose functional programming language and runtime environment. It has built-in support for concurrency, distribution and fault tolerance. Erlang is used in several large telecommunication systems from Ericsson. Erlang is open source and available for download on GitHub.
How do you reload an application's configuration? Or, what are good strategies for managing dynamic application configuration?
For example, let's say I had log levels and I wanted to change them at runtime. Also, let's assume this is one of many…
Erlang was already installed:
$dpkg -l|grep erlang
ii erlang 1:13.b.3-dfsg-2ubuntu2 Concurrent, real-time, distributed function
ii erlang-appmon 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP…
In Erlang, every process has a group leader, and when a process wants to print something (i.e. it calls the io library or does something similar), it will send a message to its group leader.
My question is, where can I find the specification of…
I am trying to fire a HTTPC post request from Erlang:
httpc:request(post, {"https://android.googleapis.com/gcm/send",[{"Authorization","key=api_key_generated_at_googleaccount"}],[{"Content-Type","application/json"}],Body},[],[])
But every time I…
I have a server that starts cowboy and ranch as an independent application — that is, they have their own supervisor, they are not in the supervisor tree of my application.
Is it best practice to include cowboy into the application's supervisor…
We have been trying to make use of the RabbitMQ Service Bus (v3.3.4) but the central bus keeps crashing. At the moment we are not using any clustering and its hosted on Windows Server 2008 R2. We'd like to isolate the root cause but the below error…
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…
I'm stuck with the very first programming exercise of Programming Erlang (2nd ed.) by Joe Armstrong. The second chapter introduces a brief program that runs locally both a file server and its client. The example only allows the client to list and…
I'm developing with Cowboy and erlang.mk and currently my flow is :
1. change code in vi, save, run make
2. close Cowboy, start Cowboy again (i'm running Cowboy in console mode for tracing/debugging purposes)
Is there a way to make Cowboy reload and…
I have a question about monitors.
1> Pid=spawn(fun() -> timer:sleep(500000) end).
2> exit(Pid, kill).
3> Ref=erlang:monitor(process, Pid).
4> flush().
The output of flush() in my shell is {'DOWN',#Ref<0.0.0.159>,process,<0.69.0>,noproc}
My…
I have a var that has some JSON data:
A = <<"{\"job\": {\"id\": \"1\"}}">>.
Using mochijson2, I decode the data:
Struct = mochijson2:decode(A).
And now I have this:
{struct,[{<<"job">>,{struct,[{<<"id">>,<<"1">>}]}}]}
I am trying to read (for…
I need function which returns true, when record has certain field and vice versa.
Example:
-record(robot, {name,
type=industrial,
hobbies,
details=[]
}).
Crusher = #robot{name="Crusher",…
I am aware that you can preform simple message passing with the following:
self() ! hello.
and you can see the message by calling:
flush().
I can also create simple processes in functions with something like:
spawn(module, function,…
I'm trying to start Erlang slave node on cluster and I receive bash: erl: command not found message. Though I have alias for erl. Here is what I actually do:
[user@n001 ~]$ erl -rsh ssh -sname n001
Eshell V5.7.5 (abort with ^G)
…