[erlang-questions] Why not standard OTP behavior

Loïc Hoguin <>
Wed Apr 29 13:50:21 CEST 2015


In the case of ranch_conns_sup, that's an optimization.

Before it was a supervisor + gen_server, but the work was kind of 
duplicated (one was using links and the other monitors for the same 
processes). Now we have one process that do both tasks (supervise and 
limit the number of concurrent connections).

On 04/29/2015 02:38 PM, linbo liao wrote:
> Hi All,
>
> When go through some open source code, I find sometimes processes are
> not standard OTP behavior like gen_server, gen_fsm, gen_event, but
> designed by internal OTP API.
>
> For example, ranch_conns_sup
> <https://github.com/ninenines/ranch/blob/master/src/ranch_conns_sup.erl>
> from ranch, riak_core_vnode_proxy
> <https://github.com/basho/riak_core/blob/develop/src/riak_core_vnode_proxy.erl>
> from riak_core.
>
> May anyone help to point the reason, why they don't use OTP behavior but
> build by internal API, any drawback for OTP behavior in a certain situation?
>
> Thanks,
> Linbo
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>

-- 
Loïc Hoguin
http://ninenines.eu


More information about the erlang-questions mailing list