[erlang-questions] preserving state through a gen_server restart

Joseph Wayne Norton <>
Sat Oct 20 03:57:48 CEST 2012


Ivan -

Ivan -

Hi.  I don't fully understand the needs of your application so please keep that in mind.

A few suggestions/comments:

 - gproc is built using "Plain Old OTP".  gproc uses an ets table and a gen_server process to store and to manage it's state.

 - If you decide not to use gproc, I'd recommend modifying your "my_lambs" process to use ets to store and to manage your state.  I'd recommend to create a process different than your "my_lambs" process to be the owner of this ets table.

 - Check this module (https://github.com/norton/gen-ets/blob/dev/src/gen_ets_reg.erl) for one recipe on using ets for such purposes.  This module implements a *very* simple process registry.

Cheers,

Joe N.

On Oct 20, 2012, at 6:02 AM, Ivan Uemlianin <> wrote:

> Thanks. gproc does look very useful and I'll read the tutorials. In the meantime, how is this kind of thing done with Plain Old OTP?
> 
> Best wishes
> 
> Ivan
> 
> 
> --
> Froh, wie seine Sonnen fliegen, ...
> 
> 
> On 19 Oct 2012, at 16:09, Joseph Wayne Norton <> wrote:
> 
>> gproc is handy way to manage processes by name.
>> 
>> On 2012/10/20, at 0:03, Ivan Uemlianin <> wrote:
>> 
>>> Or is there another way of doing this?




More information about the erlang-questions mailing list