python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Elixir: Finding Prime Numbers with Workers, Only 1 CPU Used
I'm learning Elixir and decided to write a demo application using GenServer and workers to find prime numbers.
Application
Setup
I created my application as follows:
$ mix new primes
$ cd primes
Stru...
Patrick Bucher
Votes: 0
Answers: 1
Is a GenServer :continue call synchronous?
A GenServer handle_call/3 implementation can return :continue to invoke an additional function. Are there any guarantees as to when this function will run relative to other messages?
For example, con...
David Maze
Votes: 0
Answers: 1
Erlang: Cannot start supervisor on another node
I have a simple supervisor that looks like this
-module(a_sup).
-behaviour(supervisor).
%% API
-export([start_link/0, init/1]).
start_link() ->
supervisor:start_link({local,?MODULE}, ?MODULE, [...
scottstots
Votes: 0
Answers: 1
Erlang: ets table does not persist data after gen_server crashes and restarts
I have a gen_server which stores positions of objects in an ets table like this
-module(my_gen_server).
-record(slot, {position, object}).
-behavior(gen_server).
%% API
-export([start_link/1, init/1,...
scottstots
Votes: 0
Answers: 1