[erlang-questions] multiple instances of gen_server

YC yinso.chen@REDACTED
Fri Oct 26 00:09:38 CEST 2007


Thanks for the pointer.

Looks like to use an unnamed server it I need to capture the returned PID
and pass it through call (it wasn't clear that's the case via
gen_server.erl; but it's more clear w/in gen.erl), so that should work.

Thanks,
yc

On 10/25/07, Matthew O'Gorman <mogorman@REDACTED> wrote:
>
> 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
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20071025/bdedda94/attachment.htm>


More information about the erlang-questions mailing list