[erlang-questions] about the use of parametrized modules

Hynek Vychodil hynek@REDACTED
Sat Jan 15 21:17:50 CET 2011


OTP stdlib module io is doing principally same and doesn't need
parametrized module.

On Sat, Jan 15, 2011 at 7:23 PM, Max Lapshin <max.lapshin@REDACTED> wrote:
> I can tell why I use parameterized modules in erlyvideo.
>
> This is list of module chain, where functions are called:
>
> {rtmp_handlers, [apps_login, apps_streaming]}.
>
> rtmp_session is calling in such manner:  Module:connect(Session, Funcall)
>
> Now we need a configurable module:  auth_users_limit. It requires
> somehow to store additional configuration variable: limit of users.
> The easies solution for me seems to store it as a parameter for module:
>
> {rtmp_handlers, [{auth_users_limit, 100}, apps_login, apps_streaming]}
>
> After that nothing is changed in rtmp_session:
> Module:connect(Session, Funcall), but Module now is just a tuple from
> config: {auth_users_limit, 100}.
>
> It happened to be very convenient.
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>
>



-- 
--Hynek (Pichi) Vychodil

Analyze your data in minutes. Share your insights instantly. Thrill
your boss.  Be a data hero!
Try GoodData now for free: www.gooddata.com


More information about the erlang-questions mailing list