Permalink
Fetching contributors…
Cannot retrieve contributors at this time
328 lines (182 sloc) 8.64 KB

Module gproc_dist

Extended process registry.

Behaviours: gen_leader.

Authors: Ulf Wiger (ulf@wiger.net).

Description

This module implements an extended process registry

For a detailed description, see gproc/doc/erlang07-wiger.pdf.

Function Index

code_change/4
demonitor/2
elected/2
elected/3
from_leader/3
get_leader/0Returns the node of the current gproc leader.
give_away/2
handle_DOWN/3
handle_call/4
handle_cast/3
handle_info/2
handle_info/3
handle_leader_call/4
handle_leader_cast/3
init/1
leader_call/1
leader_cast/1
monitor/2
mreg/2
munreg/2
reg/1
reg/3 Class = n - unique name | p - non-unique property | c - counter | a - aggregated counter | r - resource property | rc - resource counter.
reg_or_locate/3
reg_other/4 Class = n - unique name | a - aggregated counter | r - resource property | rc - resource counter Value = term() Attrs = [{Key, Value}].
reg_shared/3
reset_counter/1
set_attributes/2
set_attributes_shared/2
set_value/2
set_value_shared/2
start_link/0
start_link/1
surrendered/3
sync/0Synchronize with the gproc leader.
terminate/2
unreg/1
unreg_other/2
unreg_shared/1
update_counter/3
update_counters/1
update_shared_counter/2

Function Details

code_change/4

code_change(FromVsn, S, Extra, E) -> any()

demonitor/2

demonitor(Key, Ref) -> any()

elected/2

elected(S, E) -> any()

elected/3

elected(S, E, Node) -> any()

from_leader/3

from_leader(Ops, S, E) -> any()

get_leader/0


get_leader() -> node()


Returns the node of the current gproc leader.

give_away/2

give_away(Key, To) -> any()

handle_DOWN/3

handle_DOWN(Node, S, E) -> any()

handle_call/4

handle_call(X1, X2, S, E) -> any()

handle_cast/3

handle_cast(Msg, S, X3) -> any()

handle_info/2

handle_info(X1, S) -> any()

handle_info/3

handle_info(Msg, S, E) -> any()

handle_leader_call/4

handle_leader_call(X1, From, State, E) -> any()

handle_leader_cast/3

handle_leader_cast(X1, S, E) -> any()

init/1

init(Opts) -> any()

leader_call/1

leader_call(Req) -> any()

leader_cast/1

leader_cast(Msg) -> any()

monitor/2

monitor(Key, Type) -> any()

mreg/2

mreg(T, KVL) -> any()

munreg/2

munreg(T, Keys) -> any()

reg/1

reg(Key) -> any()

reg/3

reg(Key, Value, Attrs) -> any()

Class = n - unique name | p - non-unique property | c - counter | a - aggregated counter | r - resource property | rc - resource counter

reg_or_locate/3

reg_or_locate(Key, Value, Pid) -> any()

reg_other/4


reg_other(Key::{Class, g, Key}, Pid::pid(), Value, Attrs) -> true


Class = n - unique name | a - aggregated counter | r - resource property | rc - resource counter Value = term() Attrs = [{Key, Value}]

reg_shared/3

reg_shared(Key, Value, Attrs) -> any()

reset_counter/1

reset_counter(Key) -> any()

set_attributes/2

set_attributes(Key, Attrs) -> any()

set_attributes_shared/2

set_attributes_shared(Key, Attrs) -> any()

set_value/2

set_value(Key, Value) -> any()

set_value_shared/2

set_value_shared(Key, Value) -> any()

start_link/0

start_link() -> any()

start_link/1

start_link(Nodes) -> any()

surrendered/3

surrendered(State, X2, E) -> any()

sync/0


sync() -> true


Synchronize with the gproc leader

This function can be used to ensure that data has been replicated from the leader to the current node. It does so by asking the leader to ping all live participating nodes. The call will return true when all these nodes have either responded or died. In the special case where the leader dies during an ongoing sync, the call will fail with a timeout exception. (Actually, it should be a leader_died exception; more study needed to find out why gen_leader times out in this situation, rather than reporting that the leader died.)

terminate/2

terminate(Reason, S) -> any()

unreg/1

unreg(Key) -> any()

unreg_other/2

unreg_other(Key, Pid) -> any()

unreg_shared/1

unreg_shared(Key) -> any()

update_counter/3

update_counter(Key, Pid, Incr) -> any()

update_counters/1

update_counters(List) -> any()

update_shared_counter/2

update_shared_counter(Key, Incr) -> any()