diff options
author | Anders Svensson <[email protected]> | 2013-02-24 17:39:46 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2013-03-17 15:07:00 +0100 |
commit | d70a02e7415caccd13fad8dda417d0d18a112a83 (patch) | |
tree | 6b3aa51ad544e74459e5bb6c4a2fcd1d74f080ee /lib/diameter/src/base/diameter_config.erl | |
parent | 63e21fa7d8aa6761640f9cf357663b03578a5446 (diff) | |
download | otp-d70a02e7415caccd13fad8dda417d0d18a112a83.tar.gz otp-d70a02e7415caccd13fad8dda417d0d18a112a83.tar.bz2 otp-d70a02e7415caccd13fad8dda417d0d18a112a83.zip |
More flexible distribution config
Allow both share_peers and use_shared_peers to be a list of nodes, or a
function that returns a list of nodes.
Diffstat (limited to 'lib/diameter/src/base/diameter_config.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_config.erl | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/diameter/src/base/diameter_config.erl b/lib/diameter/src/base/diameter_config.erl index a638849b08..3a2e0d2140 100644 --- a/lib/diameter/src/base/diameter_config.erl +++ b/lib/diameter/src/base/diameter_config.erl @@ -573,7 +573,6 @@ make_config(SvcName, Opts) -> {false, monitor}, {?NOMASK, sequence}, {nodes, restrict_connections}]), - %% share_peers and use_shared_peers are currently undocumented. #service{name = SvcName, rec = #diameter_service{applications = Apps, @@ -592,19 +591,27 @@ opt(K, true = B) K == use_shared_peers -> B; -opt(monitor, P) - when is_pid(P) -> - P; - opt(restrict_connections, T) when T == node; - T == nodes; - T == []; - is_atom(hd(T)) -> + T == nodes -> + T; + +opt(K, T) + when (K == share_peers + orelse K == use_shared_peers + orelse K == restrict_connections), ([] == T + orelse is_atom(hd(T))) -> T; -opt(restrict_connections = K, F) -> - try diameter_lib:eval(F) of %% no guarantee that it won't fail later +opt(monitor, P) + when is_pid(P) -> + P; + +opt(K, F) + when K == restrict_connections; + K == share_peers; + K == use_shared_peers -> + try diameter_lib:eval(F) of %% but no guarantee that it won't fail later Nodes when is_list(Nodes) -> F; V -> |