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.
I have an Erlang boot script that I can launch like this:
/usr/bin/erl -boot /path/to/my-boot-script
It works when run from console, but fails without any error messages when I run it from systemd. The systemd unit file looks like…
I'm trying to create a release for my phoenix-framework project.
Everything is working fine, until my code need to do a specific action using :httpc module from OTP.
Apparently exrm, hasn't bundled the httpc module, and therefore could not find…
I'm learning Erlang and trying to use Dialyzer to get maximum type-safety when it's possible. There's a thing that I don't understand: what is the type of non-terminating function and how to denote it in -spec. Could anyone shed some light on this?
I'm writing a program that reads from an input stream, i.e.
erl -run p main -noshell -s erlang halt < input
The problem is that it takes a lot of time to read it (the input stream is huge) using this read function:
read_input(L) ->
case…
I am trying to have a function that ensures the table I need is already created and if not to create it. Here's the sample:
ensure_table_exists(Table, MnesiaTables, Nodes) ->
case lists:member(Table, MnesiaTables) of
true ->
…
Dialyzer does not signal the inconsistency in the return type of this function:
-spec myfun(integer()) -> zero | one.
myfun(0) -> zero;
myfun(1) -> one;
myfun(2) -> other_number.
but it detects in the case of the last line being
myfun(_) ->…
Here is the example:test_for_gen_server.erl
When a process got 10000 messages in its mailbox, it took 0.043 sec to finish. When the number is 50000, it should take 0.215 sec, but the reality is 2.4 sec, 10 times slower. Why?
Erlang/OTP 18 [erts-7.1]…
I ma new in erlang and I need to do some operations for all records I get from mnesia database.
Result = mnesia:dirty_read(mydatabase, {key1, key2}),
case Result of
[] ->
?DEBUG("No such record found", []);
…
I am running a gen_server and I want to do some cleanup before it exits. When I run this from the command line, I'm given an Erlang shell prompt. I have a handle_info({'EXIT'}, From, Reason}, and a terminate(Reason, State) in the gen_server…
I need to spawn several independent instances of the same gen_fsm on demand, and then be able to route calls to the correct instance.
Gproc library seems to be a great way of registering processes with arbitrary names. It has a function…
I'm trying to create key, value pair tuples out of xml. I'd like to make a list out of any nested xml. It seems like a very common thing to do, but I can't find any examples.
For instance:
The…
I was trying to convert a REST API example built using rebar to rebar3 release (http://jordenlowe.com/title/Explain_like_I_am_5_-_Erlang_REST_Framework_Cowboy). I have added jsx to app.src.
What could be the reason for this? Also is there anything I…
If an Erlang application, myapp, requires mnesia to run, then mnesia should be included in its application resource file, under key applications, so that if myapp is started, mnesia would get started automatically - it's node type by default is…
I've run into a problem where I cannot stop mnesia within my program without causing the app to hang.
I'm presently doing prototyping of mnesia within my erlang app.
In my jaus_app.erl file the start() calls:
{atomic, ok} =…