[erlang-questions] design question from a beginner

Gerald Weber gerald.weber@REDACTED
Wed Nov 5 15:30:37 CET 2014


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141105/474c4e5d/attachment.htm>


More information about the erlang-questions mailing list