Live data from Hacker News

Tell HN: I'm writing an Erlang recipes book, are you interested?

leanpub.com

41–42 of 42 posts

Re: Tell HN: I'm writing an Erlang recipes book, are you interested?

#41
post #36

Earlier quoted context omitted.

If you want a message queue bounded to length N, then make the messaging protocol such that the sending process sends up to N messages without an ack.

The point I am trying to make is that this fundamental feature of message queues (limit their length to prevent the memory exploding) should be provided by Erlang and not reimplemented over and over again by developers.This is really a basic feature in any message queue

Because what to do when the queue is full is absolutely application specific.

What happens if the message you can't add is a specific system message that allows the suspension of OTP processes for a code upgrade? Do you end up livelocked? How do you propagate back that you couldn't insert your element in the queue? Do you make message passing an operation that can fail? How would that work over the network when the message telling you something failed is lost over a netsplit? Is it a different kind of failure?

This has very deep design repercussions on the language. It's not impossible, but it wouldn't let Erlang be the same.

Re: Tell HN: I'm writing an Erlang recipes book, are you interested?

#42

Earlier quoted context omitted.

My problem with having a tree is that it implies that at every level - including at the root - there's a single point of failure. I get the error kernel concept, I just don't necessarily trust the hardware.

What you need to do then is look into a few different options. The first one is distributed Applications. This is part of the standard OTP stuff. What this does is declare a node as a master, and then failover nodes for your OTP application. When your master goes down, the other nodes take over it. Whenever the master is back, the failover nodes drop their applications and restarts it on the master. This loses all of…

Yeah, it sounds like either distributed applications (more likely 'cos it's in OTP) or gen_leader (maybe interesting technically) would be good to look at.

That being said, riak_core has been on my List Of Things To Have A Really Good Look At for a while now...

Post reply on HN