Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Feedback for OTP Tutorial Series #7
I did notice that this was the convention in every bit of Erlang code that
I've done a little tutoring of LFE lately using the approach of separating
Part of what I want to do in these tutorials is identify the Erlang
On Tue, May 26, 2015 at 12:29 PM, Robert Virding email@example.com
Quick update: Robert has talked me into using the community-standard way of combining the callback and server modules. To make this easier to digest for newcomers, I'll need to rework some things and add more explanatory text.
The sorts of question I have gotten about this include (but aren't limited to):
(Note that some of the earlier questions get asked again once they have more context and understanding.)
There are a bunch of other questions I've gotten from new users about setting up OTP servers, but they escape me at the moment. Oh, and there are a lot more for setting up supervisors.
But coming back to the point: I want to make sure that new users don't just have a Book of Convention thrown at them. Many of these questions go away if you just have them build things in a certain way and in a certain order and then explain conventions afterwards and show how conventions save in time/effort/etc. That's not so easy to guide in a blog post ... more thought required :-)
I think the third reference about using call and then doing an explicit gen_server:reply and returning a #(noreply ... ) tuple will be be very confusing to newcomers. "What is this all about, and why don't you do it for amount?"
You will end up with users neither doing gen_server:reply not return #(reply ... ) so their callers crash (timeout), or doing both and the mail queues building up, or ... No keep it straight forward: in handle_call you return a #(reply ...) and in cast you return a #(noreply ... ).
There are some specific cases when you want to do this but it should definitely go in the final OTP for experts blog.
Thanks for the feedback! I'm re-doing the post now (splitting it into two,
On Thu, May 28, 2015 at 8:48 AM, Robert Virding firstname.lastname@example.org