Re:Erlang OTP Tutorial For Beginners
by plainOldText on Friday January 04, 2013 @02:13PM
(#5009196)
I'm very happy to see more OTP tutorials as of lately. I believe OTP can be one of the most powerful tools in an Erlanger's arsenal.
[ Parent
| on HN ]
Stronger: If you are using Erlang for anything real and you aren't using OTP you are almost certainly doing it wrong.
Good point.
About the only thing I've found is the lack of pooling gen_server's built-in and limitations of using atoms for process registration as things I have design a solution for in OTP.
Otherwise, architecturally, I'm amazed at how much ground is already designed in OTP.
From R15B01 you can actually use "plugins" for process registering using the {via, Mod, Key} syntax.
Gproc supports this and using it you can do stuff like:
gen_server:start_link({via, gproc, {Your, "very", <<"complex">>, key}, [...])
you can also roll your own.Docs: http://www.erlang.org/doc/man/gen_server.html#start_link-3
> I'm amazed at how much ground is already designed in OTP.
It is really like finding hidden treasure. And it used to actually be pretty hidden. There was no official book out there. Just had to dig through docs. There is OTP in Action now and I am glad to see others.
For example I had know idea about the existence of the distributed application controller, found out about it from a Learn You Some Erlang book.
You can use Poolboy [https://github.com/devinus/poolboy] for pooling gen_server's.
Re:Erlang OTP Tutorial For Beginners
by martinjlogan on Saturday January 05, 2013 @06:26PM
(#5014450)
OTP is more than just a framework it is really an important part of the language itself. Parts of OTP like proc_lib are built right into the VM among other close ties. This is why we focus our ErlangCamps 70% on OTP constructs and we wrote the book "Erlang and OTP in Action" and not just an Erlang book. We believe that an Erlang book would really only be describing half the language. When I say Erlang what I really mean is Erlang/OTP.