aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-08-23 12:21:14 +0200
committerAnders Svensson <[email protected]>2017-08-25 13:08:41 +0200
commit5f3becaddef9b18c81a1ec8bd7bf955384c1a225 (patch)
tree23b87c1dd78c561c51c9bf534e7b7b479c9d4c44 /lib/diameter/src/base/diameter.erl
parent2d540b95755a6f628b0cfc5a9bab4ff41046fe4b (diff)
downloadotp-5f3becaddef9b18c81a1ec8bd7bf955384c1a225.tar.gz
otp-5f3becaddef9b18c81a1ec8bd7bf955384c1a225.tar.bz2
otp-5f3becaddef9b18c81a1ec8bd7bf955384c1a225.zip
Let a service configure default transport options
Only a default spawn_opt has been possible to configure, but there's no reason why most others should need to be configured per transport. Those options that still only make sense on a transport are transport_module/config (because of the semantics of multiple values), applications/capabilities (since these override service options), and private (since it's only to allow user-specific options in a backwards compatible way).
Diffstat (limited to 'lib/diameter/src/base/diameter.erl')
-rw-r--r--lib/diameter/src/base/diameter.erl31
1 files changed, 18 insertions, 13 deletions
diff --git a/lib/diameter/src/base/diameter.erl b/lib/diameter/src/base/diameter.erl
index ad6aaab440..0f919f6c25 100644
--- a/lib/diameter/src/base/diameter.erl
+++ b/lib/diameter/src/base/diameter.erl
@@ -348,6 +348,22 @@ call(SvcName, App, Message) ->
| encode
| decode.
+%% Options common to both start_service/2 and add_transport/2.
+
+-type common_opt()
+ :: {pool_size, pos_integer()}
+ | {capabilities_cb, eval()}
+ | {capx_timeout, 'Unsigned32'()}
+ | {strict_capx, boolean()}
+ | {disconnect_cb, eval()}
+ | {dpr_timeout, 'Unsigned32'()}
+ | {dpa_timeout, 'Unsigned32'()}
+ | {length_errors, exit | handle | discard}
+ | {connect_timer, 'Unsigned32'()}
+ | {watchdog_timer, 'Unsigned32'() | {module(), atom(), list()}}
+ | {watchdog_config, [{okay|suspect, non_neg_integer()}]}
+ | {spawn_opt, list()}.
+
%% Options passed to start_service/2
-type service_opt()
@@ -363,7 +379,7 @@ call(SvcName, App, Message) ->
| {strict_mbit, boolean()}
| {incoming_maxlen, message_length()}
| {use_shared_peers, remotes()}
- | {spawn_opt, list()}.
+ | common_opt().
-type application_opt()
:: {alias, app_alias()}
@@ -393,20 +409,9 @@ call(SvcName, App, Message) ->
:: {transport_module, atom()}
| {transport_config, any()}
| {transport_config, any(), 'Unsigned32'() | infinity}
- | {pool_size, pos_integer()}
| {applications, [app_alias()]}
| {capabilities, [capability()]}
- | {capabilities_cb, eval()}
- | {capx_timeout, 'Unsigned32'()}
- | {strict_capx, boolean()}
- | {disconnect_cb, eval()}
- | {dpr_timeout, 'Unsigned32'()}
- | {dpa_timeout, 'Unsigned32'()}
- | {length_errors, exit | handle | discard}
- | {connect_timer, 'Unsigned32'()}
- | {watchdog_timer, 'Unsigned32'() | {module(), atom(), list()}}
- | {watchdog_config, [{okay|suspect, non_neg_integer()}]}
- | {spawn_opt, list()}
+ | common_opt()
| {private, any()}.
%% Predicate passed to remove_transport/2