gen-server

Erlang, try to make gen_server: call with many responses

Erlang, try to make gen_server: call with many responses
Try to use OTP-style in project and got one OTP-interface question. What solution is more popular/beautiful?What I have:web-server withmochiwebone process, what spawns many (1000-2000) children. Children contain state (netflow-speed). Process proxies

What happen if i erased process dictionary of gen_server module?

What happen if i erased process dictionary of gen_server module?
I was playing with the process dictionary inside a gen_server module, i called get() function and i get something like this.{'$ancestors',[main_server,<0.30.0>]}, {'$initial_call',{child_server,init,1}}]what happen if i erased the process dictionary

The Server State which error_logger print, is the State when handling “Last message in was”?

The Server State which error_logger print, is the State when handling “Last message in was”?
forgive my poor English,I mean when a gen_server crash, the error_logger print"Last message in was"and"When Server State", The Server State value is the state before handle the Last message?In a gen_server, the state is stored by the g

Unable to start supervisor: (Protocol.UndefinedError) protocol Enumerable not implemented for

Unable to start supervisor: (Protocol.UndefinedError) protocol Enumerable not implemented for
I am trying to start a Supervisor and a GenServer:defmodule SubscriptionManagerSupervisor do use Supervisor def start_link do Supervisor.start_link(__MODULE__, [], [{:name, __MODULE__}]) end # supervisor callback def init([]) do interval = 1000 child

Erlang Supervisor Strategy For Restarting Connections to Downed Hosts

Erlang Supervisor Strategy For Restarting Connections to Downed Hosts
I'm using erlang as a bridge between services and I was wondering what advice people had for handling downed connections?I'm taking input from local files and piping them out to AMQP and it's conceivable that the AMQP broker could go down. For that c

when to use Gen_Fsm and when to use Gen_Server?

when to use Gen_Fsm and when to use Gen_Server?
After checking out Gen_Fsm and Gen_Server documents, I found that, more or less, they act as similar behavior. In my opinion, if there is one loop function for sending broadcast or listening tcp sock, it is better to use Gen_Fsm, or else to use gen_s

Timing mistake in Elixir GenServer tutorial?

Timing mistake in Elixir GenServer tutorial?
I'm going through the Elixir "Getting Started" tutorial, where the following code snippet is used:test "removes buckets on exit", %{registry: registry} do KV.Registry.create(registry, "shopping") {:ok, bucket} = KV.Registry.l

Why it would be better keeping track of #Reference than #PID when implementing a GenServer?

Why it would be better keeping track of #Reference than #PID when implementing a GenServer?
Elixir'sMix and OTP Guide Chapter GenServerexplains how to implement a registry server holding agents, usingGenServer.Each agent's PID is kept in a map, where the keys are the agent's names given by the clients and the values are the agent's PIDs.In

Erlang: gen_server or my own custom server?

Erlang: gen_server or my own custom server?
I need to write a server that will receive instructions from other modules and take actions depending on the instructions received. Efficiency is my main concern. So do I usegen_serveror do I write my own server. By "my own server" I mean someth

Debounce events with Elixir

Debounce events with Elixir
I am getting a stream of events from MQ into my Elixir consumer.In the consumer I need to:Aggregate events by their IDs andSend aggregated data for an ID downstream, if there is no new data for that ID for 3 minutes.Data set is not big in my case. Ma
What Others Are Reading