diff options
author | Anders Svensson <[email protected]> | 2014-11-13 21:56:03 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2014-11-27 11:19:29 +0100 |
commit | c29dd0129b35390334bb6d2bbed5500b7089a532 (patch) | |
tree | 1f4e6793ccd42e7c087245898a3ebc4c1ba603d1 /lib/diameter/doc/src/diameter.xml | |
parent | 743ed31108ee555db18d9833186865e85e34333e (diff) | |
download | otp-c29dd0129b35390334bb6d2bbed5500b7089a532.tar.gz otp-c29dd0129b35390334bb6d2bbed5500b7089a532.tar.bz2 otp-c29dd0129b35390334bb6d2bbed5500b7089a532.zip |
Order peers in pick_peer callbacks
The order of peers presented to a diameter_app(3) pick_peer callback has
previously not been documented, but there are use cases that are
simplified by an ordering. For example, consider preferring a direct
connection to a specified Destination-Host/Realm to any host in the
realm. The implementation previously treated this as a special case by
placing matching hosts at the head of the peers list, but the
documentation made no guarantees. Now present peers in match-order, so
that the desired sorting is the result of the following filter.
{any, [{all, [host, realm]}, realm]}
The implementation is not backwards compatible in the sense that a realm
filter alone is no longer equivalent in this case. However, as stated,
the documentation never made any guarantees regarding the sorting.
Diffstat (limited to 'lib/diameter/doc/src/diameter.xml')
-rw-r--r-- | lib/diameter/doc/src/diameter.xml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index ab9ad25a3a..00b54ffbc4 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -500,6 +500,18 @@ Matches only those peers matched by each filter in the specified list.</p> <p> Matches only those peers matched by at least one filter in the specified list.</p> + +<p> +The resulting peer list will be in match order, peers matching the +first filter of the list sorting before those matched by the second, +and so on. +For example, the following filter causes peers matching both the host +and realm filters to be presented before those matching only the realm +filter.</p> + +<pre> +{any, [{all, [host, realm]}, realm]} +</pre> </item> </taglist> |