Current section
Files
Jump to
Current section
Files
doc/cloudi_queue.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Module cloudi_queue</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<hr>
<h1>Module cloudi_queue</h1>
<ul class="index"><li><a href="#description">Description</a></li><li><a href="#types">Data Types</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>
<h3><a name="CloudI_Send_Queue">CloudI Send Queue</a></h3><p>
For internal services that need to have successful service request sends
(i.e., a timeout does not occur because a response is received within the
timeout period) with each send done asynchronously and all tracking done
with in-memory data.</p>.
<p>Copyright © 2015-2020 Michael Truog</p>
<p><b>Version:</b> 2.0.1 Dec 3 2021 17:15:33
------------------------------------------------------------------------</p>
<p><b>Authors:</b> Michael Truog (<a href="mailto:mjtruog at protonmail dot com"><tt>mjtruog at protonmail dot com</tt></a>).</p>
<h2><a name="description">Description</a></h2>
<h3><a name="CloudI_Send_Queue">CloudI Send Queue</a></h3><p>
For internal services that need to have successful service request sends
(i.e., a timeout does not occur because a response is received within the
timeout period) with each send done asynchronously and all tracking done
with in-memory data.</p>
<p>The data is not queued within this module's internal data structure,
but like all service requests, the queueing occurs in the destination
service process. This module's internal data provides tracking based
on the service request transaction id so many asynchronous service
requests may be easily managed concurrently. The alternative is to rely
on synchronous service requests and increase the sending service's
process count as necessary for concurrency, which is a simpler approach.
So, cloudi_queue usage is necessary when multiple service requests must
be sent concurrently and every request must receive a response
(receiving a response is the only proof the transaction was successful).</p>
<p>Only one instance of cloudi_queue is necessary within a service's state
due to the transaction id being globally unique.</p>
If retries are enabled (by default, no retries are attempted), it is
possible that a service request will be delivered more than once
(e.g., if the service request is processed but the response is not
sent before a timeout occurs). Each retry sends a service request
with the same transaction id, so it may be used to detect a duplicate
receive (or a separate unique id could be used from within the
RequestInfo or Request data) by checking and modifying service state.
<h2><a name="types">Data Types</a></h2>
<h3 class="typedecl"><a name="type-options">options()</a></h3>
<p><tt>options() = [{retry, non_neg_integer()} | {retry_delay, non_neg_integer()} | {suspended, boolean()} | {ordered, boolean()} | {timeout_default, <a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>} | {priority_default, <a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>} | {validate_request_info, fun((RequestInfo::<a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>) -> boolean()) | {Module1::module(), Function1::atom()}} | {validate_request, fun((RequestInfo::<a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>) -> boolean()) | {Module2::module(), Function2::atom()}} | {validate_response_info, fun((ResponseInfo::<a href="cloudi_service.html#type-response_info">cloudi_service:response_info()</a>) -> boolean()) | {Module3::module(), Function3::atom()}} | {validate_response, fun((ResponseInfo::<a href="cloudi_service.html#type-response_info">cloudi_service:response_info()</a>, Response::<a href="cloudi_service.html#type-response">cloudi_service:response()</a>) -> boolean()) | {Module4::module(), Function4::atom()}} | {failures_source_die, boolean()} | {failures_source_max_count, pos_integer()} | {failures_source_max_period, infinity | pos_integer()}]</tt></p>
<h3 class="typedecl"><a name="type-ordered_requests">ordered_requests()</a></h3>
<p><tt>ordered_requests() = <a href="queue.html#type-queue">queue:queue</a>(#request_ordered_send{name = <a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, request_info = <a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, request = <a href="cloudi_service.html#type-request">cloudi_service:request()</a>, timeout = <a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, priority = <a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>, id = <a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a>, pattern_pid = <a href="cloudi_service.html#type-pattern_pid">cloudi_service:pattern_pid()</a> | undefined} | #request_ordered_mcast{name = <a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, request_info = <a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, request = <a href="cloudi_service.html#type-request">cloudi_service:request()</a>, timeout = <a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, priority = <a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>})</tt></p>
<h3 class="typedecl"><a name="type-requests">requests()</a></h3>
<p><tt>requests() = #{<a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a> := #request{name = <a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, request_info = <a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, request = <a href="cloudi_service.html#type-request">cloudi_service:request()</a>, timeout = <a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, priority = <a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>, id = <a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a>, pattern_pid = <a href="cloudi_service.html#type-pattern_pid">cloudi_service:pattern_pid()</a>, retry_pattern_pid = boolean(), retry_count = non_neg_integer(), retry_delay = boolean()}}</tt></p>
<h3 class="typedecl"><a name="type-state">state()</a></h3>
<p><tt>state() = #cloudi_queue{retry = non_neg_integer(), retry_delay = non_neg_integer(), suspended = boolean(), ordered = boolean(), timeout_default = <a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, priority_default = <a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>, word_size = pos_integer(), service = undefined | pid(), validate_request_info = undefined | fun((any()) -> boolean()), validate_request = undefined | fun((any(), any()) -> boolean()), validate_response_info = undefined | fun((any()) -> boolean()), validate_response = undefined | fun((any(), any()) -> boolean()), failures_source_die = boolean(), failures_source_max_count = pos_integer(), failures_source_max_period = infinity | pos_integer(), failures_source = [<a href="cloudi_timestamp.html#type-seconds_monotonic">cloudi_timestamp:seconds_monotonic()</a>], suspend_requests = <a href="#type-suspend_requests">suspend_requests()</a>, ordered_requests = <a href="#type-ordered_requests">ordered_requests()</a>, ordered_pending = non_neg_integer(), requests = <a href="#type-requests">requests()</a>}</tt></p>
<h3 class="typedecl"><a name="type-suspend_requests">suspend_requests()</a></h3>
<p><tt>suspend_requests() = <a href="queue.html#type-queue">queue:queue</a>(#request_suspend_send{name = <a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, request_info = <a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, request = <a href="cloudi_service.html#type-request">cloudi_service:request()</a>, timeout = <a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, priority = <a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>, id = <a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a>, pattern_pid = <a href="cloudi_service.html#type-pattern_pid">cloudi_service:pattern_pid()</a> | undefined} | #request_suspend_mcast{name = <a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, request_info = <a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, request = <a href="cloudi_service.html#type-request">cloudi_service:request()</a>, timeout = <a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, priority = <a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>})</tt></p>
<h2><a name="index">Function Index</a></h2>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#byte_size-2">byte_size/2</a></td><td>
<h4><a name="Return_the_size_of_the_CloudI_queue_in_bytes.">Return the size of the CloudI queue in bytes.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#byte_size-4">byte_size/4</a></td><td>
<h4><a name="Return_the_size_of_the_CloudI_queue_in_bytes_with_the_additional_service_request_added.">Return the size of the CloudI queue in bytes with the additional service request added.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#byte_size-5">byte_size/5</a></td><td>
<h4><a name="Return_the_size_of_the_CloudI_queue_in_bytes_with_the_additional_service_request_added.">Return the size of the CloudI queue in bytes with the additional service request added.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#byte_size-6">byte_size/6</a></td><td>
<h4><a name="Return_the_size_of_the_CloudI_queue_in_bytes_with_the_additional_service_request_added.">Return the size of the CloudI queue in bytes with the additional service request added.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#byte_size-7">byte_size/7</a></td><td>
<h4><a name="Return_the_size_of_the_CloudI_queue_in_bytes_with_the_additional_service_request_added.">Return the size of the CloudI queue in bytes with the additional service request added.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#byte_size-8">byte_size/8</a></td><td>
<h4><a name="Return_the_size_of_the_CloudI_queue_in_bytes_with_the_additional_service_request_added.">Return the size of the CloudI queue in bytes with the additional service request added.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#failures-2">failures/2</a></td><td>
<h4><a name="Return_the_current_number_of_failures_to_send_and_validate.">Return the current number of failures to send and validate.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#handle_info-3">handle_info/3</a></td><td>
<h4><a name="Handle_all_info_messages_related_to_the_CloudI_queue.">Handle all info messages related to the CloudI queue.</a></h4>
Must be called from the <code>cloudi_service_handle_info/3</code> callback function.</td></tr>
<tr><td valign="top"><a href="#mcast-4">mcast/4</a></td><td>
<h4><a name="Send_a_multicast_service_request.">Send a multicast service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#mcast-5">mcast/5</a></td><td>
<h4><a name="Send_a_multicast_service_request.">Send a multicast service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#mcast-7">mcast/7</a></td><td>
<h4><a name="Send_a_multicast_service_request.">Send a multicast service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#new-0">new/0</a></td><td>
<h4><a name="Create_a_CloudI_queue.">Create a CloudI queue.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#new-1">new/1</a></td><td>
<h4><a name="Create_a_CloudI_queue.">Create a CloudI queue.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#recv-3">recv/3</a></td><td>
<h4><a name="Receive_a_service_request.">Receive a service request.</a></h4>
Must be called from the <code>cloudi_service_handle_info/3</code> callback function.</td></tr>
<tr><td valign="top"><a href="#recv_id-3">recv_id/3</a></td><td>
<h4><a name="Receive_a_service_request_and_provide_the_first_transaction_id.">Receive a service request and provide the first transaction id.</a></h4>
Must be called from the <code>cloudi_service_handle_info/3</code> callback function.</td></tr>
<tr><td valign="top"><a href="#resume-2">resume/2</a></td><td>
<h4><a name="Resume_sending_service_requests.">Resume sending service requests.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send-4">send/4</a></td><td>
<h4><a name="Send_a_service_request.">Send a service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send-5">send/5</a></td><td>
<h4><a name="Send_a_service_request.">Send a service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send-6">send/6</a></td><td>
<h4><a name="Send_a_service_request.">Send a service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send-7">send/7</a></td><td>
<h4><a name="Send_a_service_request.">Send a service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send-8">send/8</a></td><td>
<h4><a name="Send_a_service_request.">Send a service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_id-4">send_id/4</a></td><td>
<h4><a name="Send_a_service_request_and_provide_the_first_transaction_id.">Send a service request and provide the first transaction id.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_id-5">send_id/5</a></td><td>
<h4><a name="Send_a_service_request_and_provide_the_first_transaction_id.">Send a service request and provide the first transaction id.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_id-6">send_id/6</a></td><td>
<h4><a name="Send_a_service_request_and_provide_the_first_transaction_id.">Send a service request and provide the first transaction id.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_id-7">send_id/7</a></td><td>
<h4><a name="Send_a_service_request_and_provide_the_first_transaction_id.">Send a service request and provide the first transaction id.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_id-8">send_id/8</a></td><td>
<h4><a name="Send_a_service_request_and_provide_the_first_transaction_id.">Send a service request and provide the first transaction id.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#size-2">size/2</a></td><td>
<h4><a name="Return_the_size_of_the_CloudI_queue.">Return the size of the CloudI queue.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#suspend-2">suspend/2</a></td><td>
<h4><a name="Suspend_sending_service_requests.">Suspend sending service requests.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#timeout-3">timeout/3</a></td><td>
<h4><a name="A_service_request_timeout.">A service request timeout.</a></h4>
<code>ok</code> is returned if a service request is retried.</td></tr>
</table>
<h2><a name="functions">Function Details</a></h2>
<h3 class="function"><a name="byte_size-2">byte_size/2</a></h3>
<div class="spec">
<p><tt>byte_size(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, State::<a href="#type-state">state()</a>) -> non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Return_the_size_of_the_CloudI_queue_in_bytes.">Return the size of the CloudI queue in bytes.</a></h4>
</p>
<h3 class="function"><a name="byte_size-4">byte_size/4</a></h3>
<div class="spec">
<p><tt>byte_size(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, State::<a href="#type-state">state()</a>) -> non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Return_the_size_of_the_CloudI_queue_in_bytes_with_the_additional_service_request_added.">Return the size of the CloudI queue in bytes with the additional service request added.</a></h4>
</p>
<h3 class="function"><a name="byte_size-5">byte_size/5</a></h3>
<div class="spec">
<p><tt>byte_size(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, State::<a href="#type-state">state()</a>) -> non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Return_the_size_of_the_CloudI_queue_in_bytes_with_the_additional_service_request_added.">Return the size of the CloudI queue in bytes with the additional service request added.</a></h4>
</p>
<h3 class="function"><a name="byte_size-6">byte_size/6</a></h3>
<div class="spec">
<p><tt>byte_size(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, PatternPid::<a href="cloudi_service.html#type-pattern_pid">cloudi_service:pattern_pid()</a> | undefined, State::<a href="#type-state">state()</a>) -> non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Return_the_size_of_the_CloudI_queue_in_bytes_with_the_additional_service_request_added.">Return the size of the CloudI queue in bytes with the additional service request added.</a></h4>
</p>
<h3 class="function"><a name="byte_size-7">byte_size/7</a></h3>
<div class="spec">
<p><tt>byte_size(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, RequestInfo::<a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, Priority::<a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>, State::<a href="#type-state">state()</a>) -> non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Return_the_size_of_the_CloudI_queue_in_bytes_with_the_additional_service_request_added.">Return the size of the CloudI queue in bytes with the additional service request added.</a></h4>
</p>
<h3 class="function"><a name="byte_size-8">byte_size/8</a></h3>
<div class="spec">
<p><tt>byte_size(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, RequestInfo::<a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, Priority::<a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>, PatternPid::<a href="cloudi_service.html#type-pattern_pid">cloudi_service:pattern_pid()</a> | undefined, State::<a href="#type-state">state()</a>) -> non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Return_the_size_of_the_CloudI_queue_in_bytes_with_the_additional_service_request_added.">Return the size of the CloudI queue in bytes with the additional service request added.</a></h4>
</p>
<h3 class="function"><a name="failures-2">failures/2</a></h3>
<div class="spec">
<p><tt>failures(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, State::<a href="#type-state">state()</a>) -> non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Return_the_current_number_of_failures_to_send_and_validate.">Return the current number of failures to send and validate.</a></h4>
</p>
<h3 class="function"><a name="handle_info-3">handle_info/3</a></h3>
<div class="spec">
<p><tt>handle_info(Return_async_active::any(), State::<a href="#type-state">state()</a>, Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>) -> {ok, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>} | {ignored, State::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Handle_all_info_messages_related_to_the_CloudI_queue.">Handle all info messages related to the CloudI queue.</a></h4>
Must be called from the <code>cloudi_service_handle_info/3</code> callback function.</p>
<h3 class="function"><a name="mcast-4">mcast/4</a></h3>
<div class="spec">
<p><tt>mcast(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, State::<a href="#type-state">state()</a>) -> {ok, State::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, State::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_multicast_service_request.">Send a multicast service request.</a></h4>
</p>
<h3 class="function"><a name="mcast-5">mcast/5</a></h3>
<div class="spec">
<p><tt>mcast(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, State::<a href="#type-state">state()</a>) -> {ok, State::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, State::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_multicast_service_request.">Send a multicast service request.</a></h4>
</p>
<h3 class="function"><a name="mcast-7">mcast/7</a></h3>
<div class="spec">
<p><tt>mcast(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, RequestInfo::<a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, Priority::<a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>, State::<a href="#type-state">state()</a>) -> {ok, State::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, State::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_multicast_service_request.">Send a multicast service request.</a></h4>
</p>
<h3 class="function"><a name="new-0">new/0</a></h3>
<div class="spec">
<p><tt>new() -> <a href="#type-state">state()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Create_a_CloudI_queue.">Create a CloudI queue.</a></h4>
</p>
<h3 class="function"><a name="new-1">new/1</a></h3>
<div class="spec">
<p><tt>new(Options::<a href="#type-options">options()</a>) -> <a href="#type-state">state()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Create_a_CloudI_queue.">Create a CloudI queue.</a></h4>
</p>
<h3 class="function"><a name="recv-3">recv/3</a></h3>
<div class="spec">
<p><tt>recv(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, ReturnAsync::#return_async_active{name = <a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, pattern = <a href="cloudi_service.html#type-service_name_pattern">cloudi_service:service_name_pattern()</a>, response_info = <a href="cloudi_service.html#type-response_info">cloudi_service:response_info()</a>, response = <a href="cloudi_service.html#type-response">cloudi_service:response()</a>, timeout = <a href="cloudi_service.html#type-timeout_value_milliseconds">cloudi_service:timeout_value_milliseconds()</a>, trans_id = <a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a>}, State::<a href="#type-state">state()</a>) -> {ok, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>} | {ignored, State::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Receive_a_service_request.">Receive a service request.</a></h4>
Must be called from the <code>cloudi_service_handle_info/3</code> callback function.</p>
<h3 class="function"><a name="recv_id-3">recv_id/3</a></h3>
<div class="spec">
<p><tt>recv_id(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Return_async_active::#return_async_active{name = <a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, pattern = <a href="cloudi_service.html#type-service_name_pattern">cloudi_service:service_name_pattern()</a>, response_info = <a href="cloudi_service.html#type-response_info">cloudi_service:response_info()</a>, response = <a href="cloudi_service.html#type-response">cloudi_service:response()</a>, timeout = <a href="cloudi_service.html#type-timeout_value_milliseconds">cloudi_service:timeout_value_milliseconds()</a>, trans_id = <a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a>}, State::<a href="#type-state">state()</a>) -> {ok, Id::<a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a>, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>} | {ignored, State::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Receive_a_service_request_and_provide_the_first_transaction_id.">Receive a service request and provide the first transaction id.</a></h4>
Must be called from the <code>cloudi_service_handle_info/3</code> callback function.</p>
<h3 class="function"><a name="resume-2">resume/2</a></h3>
<div class="spec">
<p><tt>resume(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, State::<a href="#type-state">state()</a>) -> StateNew::<a href="#type-state">state()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Resume_sending_service_requests.">Resume sending service requests.</a></h4>
</p>
<h3 class="function"><a name="send-4">send/4</a></h3>
<div class="spec">
<p><tt>send(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, State::<a href="#type-state">state()</a>) -> {ok, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_service_request.">Send a service request.</a></h4>
</p>
<h3 class="function"><a name="send-5">send/5</a></h3>
<div class="spec">
<p><tt>send(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, State::<a href="#type-state">state()</a>) -> {ok, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_service_request.">Send a service request.</a></h4>
</p>
<h3 class="function"><a name="send-6">send/6</a></h3>
<div class="spec">
<p><tt>send(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, PatternPid::<a href="cloudi_service.html#type-pattern_pid">cloudi_service:pattern_pid()</a> | undefined, State::<a href="#type-state">state()</a>) -> {ok, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_service_request.">Send a service request.</a></h4>
</p>
<h3 class="function"><a name="send-7">send/7</a></h3>
<div class="spec">
<p><tt>send(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, RequestInfo::<a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, Priority::<a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>, State::<a href="#type-state">state()</a>) -> {ok, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_service_request.">Send a service request.</a></h4>
</p>
<h3 class="function"><a name="send-8">send/8</a></h3>
<div class="spec">
<p><tt>send(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, RequestInfo::<a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, Priority::<a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>, PatternPid::<a href="cloudi_service.html#type-pattern_pid">cloudi_service:pattern_pid()</a> | undefined, State::<a href="#type-state">state()</a>) -> {ok, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_service_request.">Send a service request.</a></h4>
</p>
<h3 class="function"><a name="send_id-4">send_id/4</a></h3>
<div class="spec">
<p><tt>send_id(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, State::<a href="#type-state">state()</a>) -> {ok, Id::<a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a>, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_service_request_and_provide_the_first_transaction_id.">Send a service request and provide the first transaction id.</a></h4>
</p>
<h3 class="function"><a name="send_id-5">send_id/5</a></h3>
<div class="spec">
<p><tt>send_id(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, State::<a href="#type-state">state()</a>) -> {ok, Id::<a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a>, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_service_request_and_provide_the_first_transaction_id.">Send a service request and provide the first transaction id.</a></h4>
</p>
<h3 class="function"><a name="send_id-6">send_id/6</a></h3>
<div class="spec">
<p><tt>send_id(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, PatternPid::<a href="cloudi_service.html#type-pattern_pid">cloudi_service:pattern_pid()</a> | undefined, State::<a href="#type-state">state()</a>) -> {ok, Id::<a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a>, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_service_request_and_provide_the_first_transaction_id.">Send a service request and provide the first transaction id.</a></h4>
</p>
<h3 class="function"><a name="send_id-7">send_id/7</a></h3>
<div class="spec">
<p><tt>send_id(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, RequestInfo::<a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, Priority::<a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>, State::<a href="#type-state">state()</a>) -> {ok, Id::<a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a>, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_service_request_and_provide_the_first_transaction_id.">Send a service request and provide the first transaction id.</a></h4>
</p>
<h3 class="function"><a name="send_id-8">send_id/8</a></h3>
<div class="spec">
<p><tt>send_id(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, Name::<a href="cloudi_service.html#type-service_name">cloudi_service:service_name()</a>, RequestInfo::<a href="cloudi_service.html#type-request_info">cloudi_service:request_info()</a>, Request::<a href="cloudi_service.html#type-request">cloudi_service:request()</a>, Timeout::<a href="cloudi_service.html#type-timeout_milliseconds">cloudi_service:timeout_milliseconds()</a>, Priority::<a href="cloudi_service.html#type-priority">cloudi_service:priority()</a>, PatternPid::<a href="cloudi_service.html#type-pattern_pid">cloudi_service:pattern_pid()</a> | undefined, State::<a href="#type-state">state()</a>) -> {ok, Id::<a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a>, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Send_a_service_request_and_provide_the_first_transaction_id.">Send a service request and provide the first transaction id.</a></h4>
</p>
<h3 class="function"><a name="size-2">size/2</a></h3>
<div class="spec">
<p><tt>size(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, State::<a href="#type-state">state()</a>) -> non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Return_the_size_of_the_CloudI_queue.">Return the size of the CloudI queue.</a></h4>
</p>
<h3 class="function"><a name="suspend-2">suspend/2</a></h3>
<div class="spec">
<p><tt>suspend(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, State::<a href="#type-state">state()</a>) -> StateNew::<a href="#type-state">state()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Suspend_sending_service_requests.">Suspend sending service requests.</a></h4>
</p>
<h3 class="function"><a name="timeout-3">timeout/3</a></h3>
<div class="spec">
<p><tt>timeout(Dispatcher::<a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a>, TimeoutAsync::#timeout_async_active{trans_id = <a href="cloudi_service.html#type-trans_id">cloudi_service:trans_id()</a>}, State::<a href="#type-state">state()</a>) -> {ok, StateNew::<a href="#type-state">state()</a>} | {{error, Reason::<a href="cloudi_service.html#type-error_reason">cloudi_service:error_reason()</a>}, StateNew::<a href="#type-state">state()</a>} | {ignored, State::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="A_service_request_timeout.">A service request timeout.</a></h4>
<code>ok</code> is returned if a service request is retried. Must be called from the
<code>cloudi_service_handle_info/3</code> callback function.</p>
<hr>
<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc</i></p>
</body>
</html>