[erlang-questions] Atomically replace named process?
Fri Jun 13 09:13:11 CEST 2014
These are all really useful things, thanks.
As it happens, however, my problem was with a live system, so code
changes to the existing clients or original gen_server wasn't possible
-- I couldn't persuade the gen_server to suspend (because of a full
message queue), so code swapping was difficult. I _almost_ got it
working (in test), but in the end, we decided to snaffle the message
queue (by using process_info/2), throw it to disk (using disk_log),
restart the node and deal with the old messages using some escript.
On 12 June 2014 17:00, Michael Truog <mjtruog@REDACTED> wrote:
> Yes, gproc and ets could be used if you are only using a single Erlang node.
> On 06/12/2014 07:06 AM, Bob Ippolito wrote:
> Using gproc (or even just ets) is also a solution. Whether you need the
> names to be redundant or not, using ets instead of the process registry will
> allow you to replace them atomically.
> On Wednesday, June 11, 2014, Michael Truog <mjtruog@REDACTED> wrote:
>> If you need redundant process names, you should probably look at pg2
>> (http://www.erlang.org/doc/man/pg2.html) or cpg
>> On 06/11/2014 12:17 AM, Roger Lipscombe wrote:
>>> I've got a gen_server with a particular name. I've got a bunch of
>>> other processes calling and casting to it, by name.
>>> Can I spin up another gen_server, and have the name transferred
>>> without anyone noticing? That is: can I redirect the calls and casts
>>> to the new process without interruption?
>> erlang-questions mailing list
More information about the erlang-questions