Erlang Supervisor Strategy For Restarting Connections to Downed Hosts

Posted by derdewey on Stack Overflow See other posts from Stack Overflow or by derdewey
Published on 2010-06-04T04:25:23Z Indexed on 2010/06/06 4:52 UTC
Read the original article Hit count: 394

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 peg the CPU with those connections attempts. My inclination is to put a sleep into the reboot of the AMQP code. Wouldn't that 'hack' essentially circumvent the purpose of failing quickly and letting erlang handle it? More generally, should the erlang supervisor behavior be used for handling downed connections?

© Stack Overflow or respective owner

Related posts about erlang

Related posts about behaviour