[erlang-questions] design question from a beginner

Chandru chandrashekhar.mullaparthi@REDACTED
Wed Nov 5 22:21:44 CET 2014


Hi Gerald,

You don't really need all that OTP stuff for the use case you have. You can
use them, but it would be a bit artificial. Attached is a module I use for
load testing of ibrowse - hopefully it will give you some ideas.

regards,
Chandru


On 5 November 2014 14:30, Gerald Weber <gerald.weber@REDACTED> wrote:

> Hi Coders,
>
>
>
> finally i have a first real world project to support my efforts in
> learning erlang and OTP:
>
> Trying to write an application to load-test a Java backend. This java
> daemon talks json over HTTP (jetty).
>
>
>
> The backend requires a login (GET request, no HTTP Authentication), some
> register stuff for subscriptions
>
> and finally a loop to receive all of the events (the step waiting for
> events is blocking)
>
>
>
> So my vision is:
>
> - 1x application
>
> -- 1x supervisor
>
> --- 1x (?) gen_server
>
> ---- n x Y
>
>
>
> The gen_server should wait for a msg like {start_workers,50} and should
> then start 50 instances of Y
>
> connecting to the java backend, run some httpc:request calls and receive
> the return values (which is json)
>
>
>
> I have really no clear idea which OTP principle can be used for Y, maybe
> my mindset tells me gen_server is a process to "serve data"
>
> and not to ask for data. What would be the best bet ?
>
> Or is my simple understanding that Y screams for an gen_fsm including the
> httpc calls not that wrong ?
>
>
>
> Can the supervisor be told to start x instances of Y on request ?
>
>
>
> thx and sorry for my maybe too easy questions.
>
> gerald
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141105/8c1b3449/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ibrowse_load_test.erl
Type: text/x-erlang
Size: 7529 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141105/8c1b3449/attachment.bin>


More information about the erlang-questions mailing list