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 cryptography module - ECDSA, RSA, SHA256 and so on

I need a module that can generate keypairs, compute secure hashes and crypt and sign data. Is there any that module? Or maybe there is interface for OpenSSL crypto functions ?
gordon-quad
  • 734
  • 5
  • 15
5
votes
5 answers

test if a string is a number

How to test if a string is composed only of digits ?
Bertaud
  • 2,888
  • 5
  • 35
  • 48
5
votes
1 answer

Where do values from a config or application:set_env go? How do I get them?

I am working with the Erlang MQTT broker which uses cuttlefish to generate .config files for the application. The values in the config files end up being used in the application, so for example at one point the Opts variable will contain values from…
Code Wiget
  • 1,540
  • 1
  • 23
  • 35
5
votes
2 answers

How do you use Gun as a Cowboy client?

I followed the Getting Started instructions for Cowboy, and I've got Cowboy running and listening on port 8080, and I got the Hello Erlang! response when I entered http://localhost:8080 in my browser. Now, how do I use Gun to connect to Cowboy? I…
7stud
  • 46,922
  • 14
  • 101
  • 127
5
votes
2 answers

CouchDB heart-beat time-out

My CouchDB (production) server is sometimes shut down, without my wanting it to. While inspecting logs I noticed Erlang/CouchDB (one or the other) sends a heart beat, and that heart beat is monitored. When a time-out occurs, the server is brutally…
Peter Kruithof
  • 10,584
  • 6
  • 29
  • 42
5
votes
1 answer

How to typespec generics in Elixir

I have an implementation of a Balanced Search Tree in elixir which serves as a key value store. I have a method from_list which takes a list of key value tuples and returns a tree with them. Is there a way to use generics to typespec this the way I…
Colton Voege
  • 409
  • 2
  • 5
  • 12
5
votes
2 answers

is gen_tcp:accept/1 safe?

I am implementing a server which accepts many concurrent connections. I used this structure: loop(Sock) -> case gen_tcp:accept(Sock) of {ok, CSock} -> fork_handling_process(CSock); {error, Reason} -> …
Chi Zhang
  • 771
  • 2
  • 8
  • 22
5
votes
2 answers

Sorting a list of based on the 2nd element of a tuple

I have a dictionary and want to convert it to a list. Then I would like to sort the resulting list consisting of {Key, Value} pairs from min to max depending on the 2nd element(Value). Is there a built in sort method for Lists to handle this or how…
some_id
  • 29,466
  • 62
  • 182
  • 304
5
votes
2 answers

Using ets:foldl as a poor man's forEach on every record

Short version: is it safe to use ets:foldl to delete every ETS record as one is iterating through them? Suppose an ETS table is accumulating information and now it's time to process it all. A record is read from the table, used in some way, then…
JasonSmith
  • 72,674
  • 22
  • 123
  • 149
5
votes
2 answers

How to automate module reloading when unit testing with Erlang?

I'm using Emacs and trying to get my unit testing work flow as automated as possible. I have it set up so it is working but I have to manually compile my module under test or the module containing the tests before the Erlang Shell recognizes my…
Robert Höglund
  • 10,010
  • 13
  • 53
  • 70
5
votes
1 answer

Registering a child in the process that initiated the start_child call

I have a logic module that tells a supervisor to start child processes. I need to store those childrens pid in the logic modules state. But I also need to update a childs pid if the supervisor restarts it. So I can't use the return value pid from…
JoGr
  • 1,457
  • 11
  • 22
5
votes
2 answers

ODBC link check failed error while compiling Erlang OTP on FreeBSD 10.1

I am trying to compile Erlang OTP-R16B03-1 on FreeBSD 10.1 OS. When i run the ./configure command the output is odbc : ODBC library - header check failed I have tried installing unixODBC, iODBC. Also /usr/ports/databases/unixODBC exists.…
Asha Ramaiah
  • 51
  • 1
  • 3
5
votes
3 answers

Any framework for real-time correlation/analysis of event-stream (aka CEP) in Erlang?

Would like to analyze a stream of events, sharing certain characteristics (s.a. a common source), and within a given time-window, ultimately to correlate those multiple events and draw some inference from same, and finally launch some action. My…
bdutta74
  • 2,798
  • 3
  • 31
  • 54
5
votes
2 answers

Elixir/Erlang: Communication with external process

Say I have a simple python script which executes an elixir/erlang script using the subprocess module. Say the OS PID of the python script is P1 and that of the spawned elixir/erlang script running is P2. I want to know if communication between P1…
stark
  • 97
  • 5
5
votes
1 answer

Proper escript for Hello World in erlang?

So I know that the basic Hello World Program (as in the one to output a string not the one designed for Erlang learning with spawn and other stuff) is as follows -module(hello). -export([start/0]). start() -> io:format("Hello, World!"). Then I…
phwd
  • 19,975
  • 5
  • 50
  • 78