If I have several instances of server, how can I pass info from one to another, for example:
I have this:
...
-record(id,{name,hash}).
-record(state, {id ,m, succ, pred}).
start(Name, M) ->
gen_server:start_link({local, Name}, ?MODULE, {new_ring, Name, M}, []).
join_ring(Name, Other) ->
gen_server:start_link({local, Name}, ?MODULE, {join_ring, Name, Other}, []).
...
init({new_ring, Name, M}) ->
Me=#id{name=Name,hash=M}
{ok, #state{
id = Me,
m = M,
succ = Me,
pred = nil,
}};
init({join_ring, Name, Other}) ->
Me=#id{name=Name,hash=M}
{ok, #state{
id = Me,
m = Other,
succ = Me,
pred = nil,
}}.
Let say that I have two servers, one and two. How can I access from the server one info from the state of server two?