gen-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 use gen_server or do I write my own server. By "my own server" I mean something like: -module(myserver). -export([start/0, loop/0]). start() -> spawn(myserver...

gen_server with a dict vs mnesia table vs ets

Hi, I'm building an erlang server. Users sends http requests to the server to update their status. The http request process on the server saves the user status message in memory. Every minute the server sends all messages to a remote server and clear the memory. If a user update his status several times in a minute, the last message ove...

bad_application error starting erlang gen_server application

I have written a simple erlang app using gen_server. When starting it with application:start(myapp), I get the following tuple... {error,{bad_application,{appliction,myapp ... (rest of my application config). There are no other error or warning messages. I have also tried to google examples of how to configure gen_server and also the...

erlang OTP Supervisor crashing

I'm working through the Erlang documentation, trying to understand the basics of setting up an OTP gen_server and supervisor. Whenever my gen_server crashes, my supervisor crashes as well. In fact, whenever I have an error on the command line, my supervisor crashes. I expect the gen_server to be restarted when it crashes. I expect comm...

[ERLANG] Priority send and receive

I have a problem that I wonder if it can be efficiently implemented in ERLANG. I have a bunch of nodes communicating with each other using a protocol that adds priority information to messages. I would like to be able to send the highest priority messages first (at the sender) and handle them first at the receiver, before the lower-prio...

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 case I would want to keep retrying to connect to the AMQP server but I don't want to pe...