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
1 answer

Using the Erlang Observer App with a remote Elixir Phoenix server inside Docker

What I am trying to do is to run the Erlang Observer App locally and then connect to a remote Docker container that is running my Elixir/Phoenix app in production. The problem I am having is not being able to connect. From my research it seems that…
shdblowers
  • 95
  • 1
  • 5
5
votes
1 answer

gen_tcp smushed messages

I'm using socket_server from this tutorial and the following code for a client and server: Server: -module(echo_server). -export([start/0, loop/1]). % echo_server specific code start() -> spawn(socket_server, start, [?MODULE, 7000, {?MODULE,…
nmichaels
  • 49,466
  • 12
  • 107
  • 135
5
votes
1 answer

`when` reserved word in erlang

I started off this morning trying to work out what the 'when' statement is used for in erlang. I know the below example is wrong: do_larger() -> io:format("Larger~n"). do_smaller() -> io:format("Smaller~n"). when_version(Size) -> when…
MattyW
  • 1,519
  • 3
  • 16
  • 33
5
votes
2 answers

Parsing a torrent file - hash info. (Erlang)

I'm trying to come up with the correct url-encoded info hash to send to the tracker in order to get the peers list. For testing, I tried parsing the torrent in this url. After opening the file, manually cut the info dictionary piece and SHA1-hash…
Taher
  • 11,902
  • 2
  • 28
  • 44
5
votes
2 answers

Erlang: designing a service component that's immutable but slow to start

I am developing a web service with Erlang. Low latency is a goal. The service provides several views of a set of files. Building these views takes time, since I have to read in the files, parse them as CSV, store their fields in records, etc. The…
Philip
  • 1,532
  • 12
  • 23
5
votes
4 answers

How can I calculate a file checksum in Elixir?

I need to calculate the md5 sum of a file in Elixir, how can this be achieved? I would expect that something like: iex(15)> {:ok, f} = File.open "file" {:ok, #PID<0.334.0>} iex(16)> :crypto.hash(:md5, f) ** (ArgumentError) argument error …
aeliton
  • 351
  • 4
  • 12
5
votes
1 answer

Mnesia Clustering

If I am clustering 2 nodes together, from my experimenting and reading up online I understand that Node A will be like a "master" node and Node B will copy the tables over if I want them to. (Otherwise it will just access them remotely.) What…
ewindsor
  • 885
  • 10
  • 24
5
votes
2 answers

Memory Monitoring Tool for Erlang Threads

Anyone know of a decent tool to monitor the total memory usage of a program that spawns a lot of threads? I'm really new to developing in Erlang and would appreciate any help! Thanks in advance :D
K-RAN
  • 896
  • 1
  • 13
  • 26
5
votes
1 answer

How Arbiters from the actor model are implemented in Erlang?

I know that Erlang uses Actor model to support concurrency and Erlang processes are the same as Actors: they send messages, immutable and so on. But according to Carl Hewitt one important thing in the Actor Model is indeterminism and Arbiters (Given…
5
votes
1 answer

Why Erlang allows an atom to include bare @ signs? Does it have a practical usage?

The Erlang official user's guide (http://erlang.org/doc/reference_manual/data_types.html#id67942) says: An atom is to be enclosed in single quotes (') if it does not begin with a lower-case letter or if it contains other characters than…
Tsutomu
  • 4,848
  • 1
  • 46
  • 68
5
votes
1 answer

Connecting to a remote node

I am on a remote machine, it has a running Erlang VM node on it. I'm trying to connect to Erlang VM node via iex but get an error back: $ iex --name testing@127.0.0.1 --remsh myapp@127.0.0.1 --setcookie…
oldhomemovie
  • 14,621
  • 13
  • 64
  • 99
5
votes
1 answer

How to start an iex session with cookie and erl options

If I start an IEx session in the following manner the cookie is set correctly. $ iex --name example@10.10.10.2 --cookie mycookie -S mix ... iex(example@10.10.10.2)1> :erlang.get_cookie :mycookie However if I also set erlang arguments to get use my…
Peter Saxton
  • 4,466
  • 5
  • 33
  • 51
5
votes
1 answer

Erlang "badarg", Not sure how to handle

Before I start, I have already checked out Handle badarg in Erlang But I am still not successful in my undefined checks so I removed them. I am building a dummy bank process and when a client does a balance query check to the bank process, the…
Q.H.
  • 1,406
  • 2
  • 17
  • 33
5
votes
2 answers

A common setup and teardown method for Erlang Eunit test suites

I am trying to check if all the indexes I have defined in MongoDB are being used by my application and that there are no extra indexes. I have a utility that does that for a single Eunit test suite. However, some of my components have more than one…
Vishal
  • 1,169
  • 2
  • 12
  • 20
5
votes
1 answer

Where to put data for an Erlang release to run

I used rebar to create a release for my Erlang application. My application need to read data from a file. Normally, it is located in the directory where I start erl. But when it comes to release, I don't know where can I put the data so as the…