[erlang-questions] multiple instances of gen_server

Matthew O'Gorman mogorman@REDACTED
Thu Oct 25 23:58:00 CEST 2007


if you read the man page or the docs, you dont have to register a name
to start start_link, also you can pass any term for the name so you
can pass a pid for example or a tuple with a complex unique name.

anyways hope this helps

mog

On 10/25/07, YC <yinso.chen@REDACTED> wrote:
> Hi all -
>
> can there be multiple instances of a gen_server module on the same node?  I
> couldn't find the answer googling (though I probably missed it), but reading
> through the source code it seems that the server process is registered by
> name, so by default it appears to be a singleton.
>
> The gen_server start template from erlang mode and programming erlang looks
> like
>
> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
>
> Could it be that to enable multiple instances, instead of using ?MODULE as
> the name, I pass in a different name myself and explicitly pass the name
> through the API to get to the correct server?
>
> Any insights are appreciated, thanks,
> yc
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list