Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:25
erlang
4124-megaco-Types-and-spec-for-megaco-cast-3.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 4124-megaco-Types-and-spec-for-megaco-cast-3.patch of Package erlang
From d011a83c6f473c4a33899a9b3c65ee26d6704f10 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Thu, 21 Dec 2023 12:35:24 +0100 Subject: [PATCH 04/46] [megaco] Types and spec for megaco:cast/3 OTP-18920 --- lib/megaco/doc/src/megaco.xml | 61 ++++++++++++++++++----------------- lib/megaco/src/app/megaco.erl | 16 +++++++++ 2 files changed, 48 insertions(+), 29 deletions(-) diff --git a/lib/megaco/doc/src/megaco.xml b/lib/megaco/doc/src/megaco.xml index 04174eeb7a..9a022a08f0 100644 --- a/lib/megaco/doc/src/megaco.xml +++ b/lib/megaco/doc/src/megaco.xml @@ -1670,37 +1670,40 @@ megaco_incr_timer() = #megaco_incr_timer{} </func> <func> - <name since="">cast(ConnHandle, Actions, Options) -> ok | {error, Reason}</name> + <name name="cast" arity="3" clause_i="1" since=""/> <fsummary>Sends one or more transaction request(s) but does NOT wait for a reply</fsummary> - <type> - <v>ConnHandle = conn_handle()</v> - <v>Actions = action_reqs() | [action_reqs()]</v> - <v>action_reqs() = binary() | [action_request()]</v> - <v>Options = [send_option()]</v> - <v>send_option() = {request_keep_alive_timeout, request_keep_alive_timeout()} | {request_timer, megaco_timer()} | {long_request_timer, megaco_timer()} | {send_handle, term()} | {reply_data, reply_data()} | {protocol_version, integer()}</v> - <v>request_keep_alive_timeout() = plain | integer() >= 0</v> - <v>Reason = term()</v> - </type> <desc> - <p>Sends one or more transaction request(s) but does NOT wait for a reply</p> - <p>When sending one transaction in a message, <c><![CDATA[Actions]]></c> should be - <c><![CDATA[action_reqs()]]></c>. When sending several transactions in a message, - <c><![CDATA[Actions]]></c> should be <c><![CDATA[[action_reqs()]]]></c>. Each element of the - list is part of one transaction.</p> - <p>For some of <em>our</em> codecs (not binary), it is also possible - to pre-encode the actions, in which case <c><![CDATA[Actions]]></c> will be - either a <c><![CDATA[binary()]]></c> or <c><![CDATA[[binary()]]]></c>.</p> - <p>The default values of the send options are obtained by - megaco:conn_info(ConnHandle, Item). But the send options above, - may explicitly be overridden.</p> - <p>The ProtocolVersion version is the version actually encoded - in the reply message.</p> - <p>The callback function UserMod:handle_trans_reply/4 is invoked - when the reply arrives, when the request timer eventually - times out or when the outstanding requests are explicitly - cancelled. See the megaco_user module for more info about - the callback arguments.</p> - <p>Given as UserData argument to UserMod:handle_trans_reply/4.</p> + <p>Sends one or more transaction request(s) + but does NOT wait for a reply</p> + + <p>When sending one transaction in a message, + <c><![CDATA[ActionRequests]]></c> should be + <c><![CDATA[action_reqs()]]></c>. + When sending several transactions in a message, + <c><![CDATA[ActionRequests]]></c> should be + <c><![CDATA[[action_reqs()]]]></c>. Each element of the + list is part of one transaction.</p> + + <p>For some of <em>our</em> codecs (not binary), it is also possible + to pre-encode the actions, in which case <c><![CDATA[Actions]]></c> + will be + either a <c><![CDATA[binary()]]></c> or + <c><![CDATA[[binary()]]]></c>.</p> + + <p>The default values of the send options are obtained by + megaco:conn_info(ConnHandle, Item). But the send options above, + may explicitly be overridden.</p> + + <p>The ProtocolVersion version is the version actually encoded + in the reply message.</p> + + <p>The callback function UserMod:handle_trans_reply/4 is invoked + when the reply arrives, when the request timer eventually + times out or when the outstanding requests are explicitly + cancelled. See the megaco_user module for more info about + the callback arguments.</p> + <p>Given as <c><![CDATA[ReplyData]]></c> argument to + UserMod:handle_trans_reply/4.</p> <marker id="encode_actions"></marker> </desc> diff --git a/lib/megaco/src/app/megaco.erl b/lib/megaco/src/app/megaco.erl index 4ba63ad538..5d0b165cc8 100644 --- a/lib/megaco/src/app/megaco.erl +++ b/lib/megaco/src/app/megaco.erl @@ -357,6 +357,22 @@ call(ConnHandle, ActionRequests, Options) -> %% Sends a transaction request but does NOT wait for a reply %%----------------------------------------------------------------- +-spec cast(ConnHandle, ActionRequests, SendOptions) -> + ok | {error, Reason} when + ConnHandle :: conn_handle(), + ActionRequests :: action_reqs() | [action_reqs()], + SendOptions :: [SendOption], + SendOption :: {request_keep_alive_timeout, RequestKeepAliveTimer} | + {request_timer, megaco_timer()} | + {long_request_timer, megaco_timer()} | + {send_handle, send_handle()} | + {reply_data, ReplyData} | + {protocol_version, ProtocolVersion}, + RequestKeepAliveTimer :: plain | non_neg_integer(), + ReplyData :: term(), + ProtocolVersion :: protocol_version(), + Reason :: term(). + cast(ConnHandle, ActionRequests, Options) -> megaco_messenger:cast(ConnHandle, ActionRequests, Options). -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor