[erlang-questions] noob gen_leader question

Ulf Wiger ulf@REDACTED
Fri Apr 18 08:52:27 CEST 2008


 The local-only mode was a way to allow the process to start before
the distribution was activated. In gproc, I allowed only local
registrations until a leader was elected, and I provided no function
for going back to local mode, once activated.

BR,
Ulf W

2008/4/18, db <masterofquestions@REDACTED>:
> My erlang nodes are setup to connect to each other automatically.
> Patched version of gen_leader states that it was modified to start
> only on local mode and user has to trigger the election mode. This
> means each instance of gen_leader is myopic and is contained within a
> single node that it is running on.  How does a user trigger the
> election mode so that all other the instances of gen_leader know the
> existence of each other?
>
> It starts off with global mode:
> elected([], {election,<0.64.0>,global,aname,a@REDACTED,
>
> Then it goes into local mode:
> initial call: gen:init_it(gen_leader,<0.62.0>,self,
>                               {local,aname},
>
> On Sun, Apr 13, 2008 at 3:57 PM, Ulf Wiger (TN/EAB)
> <ulf.wiger@REDACTED> wrote:
> > db skrev:
> >
> >
> > > Does worker instance of gen_leader spawn separate processes to perform a
> task concurrently like in pool module?
> > >
> >
> > Not by default, no. If you want to spawn processes, you
> > can of course do that in the callbacks.
> >
> > BR,
> > Ulf W
> >
>
>
>
> --
> rk
>
> That which we persist in doing becomes easier for us to do; not that
> the nature of the thing itself is changed, but that our power to do is
> increased.
> -Ralph Waldo Emerson
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list