Questions tagged [erlang]

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.

Some Erlang features:

Online Resources:

Erlang Books:

9600 questions
5
votes
2 answers

Erlang: How do you reload an application env configuration?

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…
mwt
  • 183
  • 5
5
votes
1 answer

Erlang OTP UDP Server

Here is a simple UDP server: -module(kvstore_udpserver). -author("mylesmcdonnell"). %% API -export([start/0]). start() -> spawn(fun() -> server(2346) end). server(Port) -> {ok, Socket} = gen_udp:open(Port, [binary]), …
Myles McDonnell
  • 12,943
  • 17
  • 66
  • 116
5
votes
1 answer

How do I install LFE on Ubuntu Karmic?

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…
user89021
  • 14,784
  • 16
  • 53
  • 65
5
votes
2 answers

Is there a specification of the group leader protocol that handles IO?

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…
hcs42
  • 13,376
  • 6
  • 41
  • 36
5
votes
1 answer

Setting headers in a HTTPC post request in Erlang

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…
Geek
  • 698
  • 1
  • 6
  • 25
5
votes
1 answer

Is it recommended to add cowboy to the application supervisor tree?

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…
zztczcx
  • 430
  • 1
  • 5
  • 19
5
votes
0 answers

Isolating cause of Erlang and RabbitMQ crashes

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…
JoeGeeky
  • 3,746
  • 6
  • 36
  • 53
5
votes
2 answers

Cannot spawn an erlang supervisor from the shell

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…
drfloob
  • 3,154
  • 1
  • 24
  • 31
5
votes
2 answers

file:write_file/2 returns {error, badarg} when given a binary

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…
stefanobaghino
  • 11,253
  • 4
  • 35
  • 63
5
votes
4 answers

How can I do hot code reload when developing with Cowboy?

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…
voltaire
  • 213
  • 2
  • 8
5
votes
3 answers

Monitors in Erlang/OTP

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…
tintin
  • 135
  • 2
  • 4
5
votes
5 answers

Decode JSON with mochijson2 in Erlang

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…
Jon Romero
  • 4,062
  • 6
  • 36
  • 34
5
votes
3 answers

Erlang. Records. Existing of field

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",…
5
votes
2 answers

Is it possible to send a message to an unregistered processes in Erlang?

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,…
Opentuned
  • 1,477
  • 17
  • 21
5
votes
5 answers

Erlang: starting slave node

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) …
Zim
  • 585
  • 2
  • 8
  • 15