Current section
Files
Jump to
Current section
Files
doc/cloudi_service.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_service</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_service</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_Internal_Service_Behavior">CloudI Internal Service Behavior</a></h3>
The interface which all internal services must implement.
<p>Copyright © 2011-2017 Michael Truog</p>
<p><b>Version:</b> 1.7.1 Sep 12 2017 17:11:52
------------------------------------------------------------------------</p>
<p><b>This module defines the <tt>cloudi_service</tt> behaviour.</b><br> Required callback functions: <tt>cloudi_service_init/4</tt>, <tt>cloudi_service_terminate/3</tt>.<br> Optional callback functions: <tt>cloudi_service_handle_request/11</tt>, <tt>cloudi_service_handle_info/3</tt>.</p>
<p><b>Authors:</b> Michael Truog (<a href="mailto:mjtruog [at] gmail (dot) com"><tt>mjtruog [at] gmail (dot) com</tt></a>).</p>
<h2><a name="description">Description</a></h2>
<h3><a name="CloudI_Internal_Service_Behavior">CloudI Internal Service Behavior</a></h3>
The interface which all internal services must implement.
<pre> The user module should export:
cloudi_service_init(Args, Prefix, Timeout, Dispatcher)
==> {ok, State}
{stop, Reason}
{stop, Reason, State}
State = undefined, if not returned
Reason = restart | shutdown | Term, terminate(State) is called
cloudi_service_handle_request(Type, Name, Pattern,
RequestInfo, Request, Timeout, Priority,
TransId, Pid, State, Dispatcher)
==> {reply, Response, NewState}
{reply, ResponseInfo, Response, NewState}
{forward, NextName, NextRequestInfo, NextRequest, NewState}
{forward, NextName, NextRequestInfo, NextRequest,
NextTimeout, NextPriority, NewState}
{noreply, NewState}
{stop, Reason, NewState}
Reason = restart | shutdown | Term, terminate(State) is called
cloudi_service_handle_info(Request, State, Dispatcher)
==> {noreply, State}
{stop, Reason, NewState}
Reason = restart | shutdown | Term, terminate(State) is called
cloudi_service_terminate(Reason, Timeout,
State) Let the user module clean up
always called when the service terminates
==> ok
The work flow (of the service) can be described as follows:
User module Generic
----------- -------
cloudi_service_init <----- .
loop
cloudi_service_handle_request <----- .
-----> reply
cloudi_service_handle_info <----- .
cloudi_service_terminate <----- .</pre>
<h2><a name="types">Data Types</a></h2>
<h3 class="typedecl"><a name="type-dispatcher">dispatcher()</a></h3>
<p><tt>dispatcher() = pid()</tt></p>
<h3 class="typedecl"><a name="type-error_reason">error_reason()</a></h3>
<p><tt>error_reason() = timeout</tt></p>
<h3 class="typedecl"><a name="type-error_reason_sync">error_reason_sync()</a></h3>
<p><tt>error_reason_sync() = <a href="#type-error_reason">error_reason()</a></tt></p>
<h3 class="typedecl"><a name="type-key_values">key_values()</a></h3>
<p><tt>key_values() = <a href="cloudi_key_value.html#type-key_values">cloudi_key_value:key_values()</a></tt></p>
<h3 class="typedecl"><a name="type-key_values">key_values()</a></h3>
<p><tt>key_values(Key, Value) = <a href="cloudi_key_value.html#type-key_values">cloudi_key_value:key_values</a>(Key, Value)</tt></p>
<h3 class="typedecl"><a name="type-pattern_pid">pattern_pid()</a></h3>
<p><tt>pattern_pid() = <a href="cloudi.html#type-pattern_pid">cloudi:pattern_pid()</a></tt></p>
<h3 class="typedecl"><a name="type-priority">priority()</a></h3>
<p><tt>priority() = <a href="cloudi.html#type-priority">cloudi:priority()</a></tt></p>
<h3 class="typedecl"><a name="type-priority_value">priority_value()</a></h3>
<p><tt>priority_value() = <a href="cloudi.html#type-priority_value">cloudi:priority_value()</a></tt></p>
<h3 class="typedecl"><a name="type-request">request()</a></h3>
<p><tt>request() = <a href="cloudi.html#type-request">cloudi:request()</a></tt></p>
<h3 class="typedecl"><a name="type-request_info">request_info()</a></h3>
<p><tt>request_info() = <a href="cloudi.html#type-request_info">cloudi:request_info()</a></tt></p>
<h3 class="typedecl"><a name="type-request_result">request_result()</a></h3>
<p><tt>request_result() = {reply, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>} | {forward, NextName::<a href="#type-service_name">service_name()</a>, NextRequestInfo::<a href="#type-request_info">request_info()</a>, NextRequest::<a href="#type-request">request()</a>, NextTimeout::<a href="#type-timeout_value_milliseconds">timeout_value_milliseconds()</a>, NextPriority::<a href="#type-priority_value">priority_value()</a>} | noreply</tt></p>
<h3 class="typedecl"><a name="type-request_type">request_type()</a></h3>
<p><tt>request_type() = send_async | send_sync</tt></p>
<h3 class="typedecl"><a name="type-response">response()</a></h3>
<p><tt>response() = <a href="cloudi.html#type-response">cloudi:response()</a></tt></p>
<h3 class="typedecl"><a name="type-response_info">response_info()</a></h3>
<p><tt>response_info() = <a href="cloudi.html#type-response_info">cloudi:response_info()</a></tt></p>
<h3 class="typedecl"><a name="type-service_name">service_name()</a></h3>
<p><tt>service_name() = <a href="cloudi.html#type-service_name">cloudi:service_name()</a></tt></p>
<h3 class="typedecl"><a name="type-service_name_pattern">service_name_pattern()</a></h3>
<p><tt>service_name_pattern() = <a href="cloudi.html#type-service_name_pattern">cloudi:service_name_pattern()</a></tt></p>
<h3 class="typedecl"><a name="type-service_name_pattern_suffix">service_name_pattern_suffix()</a></h3>
<p><tt>service_name_pattern_suffix() = <a href="cloudi.html#type-service_name_pattern_suffix">cloudi:service_name_pattern_suffix()</a></tt></p>
<h3 class="typedecl"><a name="type-source">source()</a></h3>
<p><tt>source() = pid()</tt></p>
<h3 class="typedecl"><a name="type-timeout_milliseconds">timeout_milliseconds()</a></h3>
<p><tt>timeout_milliseconds() = <a href="cloudi.html#type-timeout_milliseconds">cloudi:timeout_milliseconds()</a></tt></p>
<h3 class="typedecl"><a name="type-timeout_value_milliseconds">timeout_value_milliseconds()</a></h3>
<p><tt>timeout_value_milliseconds() = <a href="cloudi.html#type-timeout_value_milliseconds">cloudi:timeout_value_milliseconds()</a></tt></p>
<h3 class="typedecl"><a name="type-trans_id">trans_id()</a></h3>
<p><tt>trans_id() = <a href="cloudi.html#type-trans_id">cloudi:trans_id()</a></tt></p>
<p> version 1 UUID</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="#context_options-1">context_options/1</a></td><td>
<h4><a name="Get_the_context_options_from_the_service's_configuration.">Get the context options from the service's configuration.</a></h4>
A service would only use this when delaying the creation of a context
for child processes.</td></tr>
<tr><td valign="top"><a href="#demonitor-2">demonitor/2</a></td><td>
<h4><a name="Demonitor_an_Erlang_pid.">Demonitor an Erlang pid.</a></h4>
The function will make sure an Erlang pid is demonitored properly.</td></tr>
<tr><td valign="top"><a href="#demonitor-3">demonitor/3</a></td><td>
<h4><a name="Demonitor_an_Erlang_pid_with_options.">Demonitor an Erlang pid with options.</a></h4>
The function will make sure an Erlang pid is demonitored properly.</td></tr>
<tr><td valign="top"><a href="#destination_refresh_immediate-1">destination_refresh_immediate/1</a></td><td>
<h4><a name="Configured_service_destination_refresh_is_immediate.">Configured service destination refresh is immediate.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#destination_refresh_lazy-1">destination_refresh_lazy/1</a></td><td>
<h4><a name="Configured_service_destination_refresh_is_lazy.">Configured service destination refresh is lazy.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#dispatcher-1">dispatcher/1</a></td><td>
<h4><a name="Return_the_Erlang_pid_representing_the_service_sender.">Return the Erlang pid representing the service sender.</a></h4>
Use when the Dispatcher is stored and used after the current
cloudi_service callback has returned.</td></tr>
<tr><td valign="top"><a href="#duo_mode-1">duo_mode/1</a></td><td>
<h4><a name="Determine_if_duo_mode_is_enabled.">Determine if duo_mode is enabled.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#forward-9">forward/9</a></td><td>
<h4><a name="Forward_a_service_request.">Forward a service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#forward_async-8">forward_async/8</a></td><td>
<h4><a name="Forward_an_asynchronous_service_request.">Forward an asynchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#forward_sync-8">forward_sync/8</a></td><td>
<h4><a name="Forward_a_synchronous_service_request.">Forward a synchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#get_pid-2">get_pid/2</a></td><td>
<h4><a name="Get_a_service_destination_based_on_a_service_name.">Get a service destination based on a service name.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#get_pid-3">get_pid/3</a></td><td>
<h4><a name="Get_a_service_destination_based_on_a_service_name.">Get a service destination based on a service name.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#get_pids-2">get_pids/2</a></td><td>
<h4><a name="Get_all_service_destinations_based_on_a_service_name.">Get all service destinations based on a service name.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#get_pids-3">get_pids/3</a></td><td>
<h4><a name="Get_a_service_destination_based_on_a_service_name.">Get a service destination based on a service name.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#mcast_async-3">mcast_async/3</a></td><td>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
Asynchronous service requests are sent to all services that have
subscribed to the service name pattern that matches the destination.</td></tr>
<tr><td valign="top"><a href="#mcast_async-4">mcast_async/4</a></td><td>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
Asynchronous service requests are sent to all services that have
subscribed to the service name pattern that matches the destination.</td></tr>
<tr><td valign="top"><a href="#mcast_async-6">mcast_async/6</a></td><td>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
Asynchronous service requests are sent to all services that have
subscribed to the service name pattern that matches the destination.</td></tr>
<tr><td valign="top"><a href="#mcast_async_active-3">mcast_async_active/3</a></td><td>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
Asynchronous service requests are sent to all services that have
subscribed to the service name pattern that matches the destination.</td></tr>
<tr><td valign="top"><a href="#mcast_async_active-4">mcast_async_active/4</a></td><td>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
Asynchronous service requests are sent to all services that have
subscribed to the service name pattern that matches the destination.</td></tr>
<tr><td valign="top"><a href="#mcast_async_active-6">mcast_async_active/6</a></td><td>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
Asynchronous service requests are sent to all services that have
subscribed to the service name pattern that matches the destination.</td></tr>
<tr><td valign="top"><a href="#mcast_async_passive-3">mcast_async_passive/3</a></td><td>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
An alias for mcast_async.</td></tr>
<tr><td valign="top"><a href="#mcast_async_passive-4">mcast_async_passive/4</a></td><td>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
An alias for mcast_async.</td></tr>
<tr><td valign="top"><a href="#mcast_async_passive-6">mcast_async_passive/6</a></td><td>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
An alias for mcast_async.</td></tr>
<tr><td valign="top"><a href="#monitor-2">monitor/2</a></td><td>
<h4><a name="Monitor_an_Erlang_pid.">Monitor an Erlang pid.</a></h4>
The function will make sure an Erlang pid is monitored properly so the
cloudi_service_handle_info/3 callback receives the monitor result.</td></tr>
<tr><td valign="top"><a href="#prefix-1">prefix/1</a></td><td>
<h4><a name="Configured_service_default_prefix.">Configured service default prefix.</a></h4>
All subscribed/unsubscribed service names use this prefix.</td></tr>
<tr><td valign="top"><a href="#priority_default-1">priority_default/1</a></td><td>
<h4><a name="Configured_service_default_priority.">Configured service default priority.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#process_count-1">process_count/1</a></td><td>
<h4><a name="Return_the_initial_process_count_of_this_instance_of_the_service.">Return the initial process count of this instance of the service.</a></h4>
The configuration of the service defined how many instances should exist.</td></tr>
<tr><td valign="top"><a href="#process_count_max-1">process_count_max/1</a></td><td>
<h4><a name="Return_the_process_count_maximum_of_this_instance_of_the_service.">Return the process count maximum of this instance of the service.</a></h4>
This will be the same as the process_count, unless count_process_dynamic
configuration provides a maximum that is greater than the process_count.</td></tr>
<tr><td valign="top"><a href="#process_count_min-1">process_count_min/1</a></td><td>
<h4><a name="Return_the_process_count_minimum_of_this_instance_of_the_service.">Return the process count minimum of this instance of the service.</a></h4>
This will be the same as the process_count, unless count_process_dynamic
configuration provides a minimum that is less than the process_count.</td></tr>
<tr><td valign="top"><a href="#process_index-1">process_index/1</a></td><td>
<h4><a name="Return_the_0-based_index_of_this_instance_of_the_service.">Return the 0-based index of this instance of the service.</a></h4>
The configuration of the service defined how many instances should exist.</td></tr>
<tr><td valign="top"><a href="#recv_async-1">recv_async/1</a></td><td>
<h4><a name="Receive_an_asynchronous_service_request.">Receive an asynchronous service request.</a></h4>
Use a null TransId to receive the oldest service request.</td></tr>
<tr><td valign="top"><a href="#recv_async-2">recv_async/2</a></td><td>
<h4><a name="Receive_an_asynchronous_service_request.">Receive an asynchronous service request.</a></h4>
Either use the supplied TransId to receive the specific service request
or use a null TransId to receive the oldest service request.</td></tr>
<tr><td valign="top"><a href="#recv_async-3">recv_async/3</a></td><td>
<h4><a name="Receive_an_asynchronous_service_request.">Receive an asynchronous service request.</a></h4>
Either use the supplied TransId to receive the specific service request
or use a null TransId to receive the oldest service request.</td></tr>
<tr><td valign="top"><a href="#recv_async-4">recv_async/4</a></td><td>
<h4><a name="Receive_an_asynchronous_service_request.">Receive an asynchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#recv_asyncs-2">recv_asyncs/2</a></td><td>
<h4><a name="Receive_asynchronous_service_requests.">Receive asynchronous service requests.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#recv_asyncs-3">recv_asyncs/3</a></td><td>
<h4><a name="Receive_asynchronous_service_requests.">Receive asynchronous service requests.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#recv_asyncs-4">recv_asyncs/4</a></td><td>
<h4><a name="Receive_asynchronous_service_requests.">Receive asynchronous service requests.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#return-2">return/2</a></td><td>
<h4><a name="Return_a_service_response.">Return a service response.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#return-3">return/3</a></td><td>
<h4><a name="Return_a_service_response.">Return a service response.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#return-9">return/9</a></td><td>
<h4><a name="Return_a_service_response.">Return a service response.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#return_async-8">return_async/8</a></td><td>
<h4><a name="Return_an_asynchronous_service_response.">Return an asynchronous service response.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#return_nothrow-9">return_nothrow/9</a></td><td>
<h4><a name="Return_a_service_response_without_exiting_the_request_handler.">Return a service response without exiting the request handler.</a></h4>
Should rarely, if ever, be used.</td></tr>
<tr><td valign="top"><a href="#return_sync-8">return_sync/8</a></td><td>
<h4><a name="Return_a_synchronous_service_response.">Return a synchronous service response.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#self-1">self/1</a></td><td>
<h4><a name="Return_the_Erlang_pid_representing_the_service.">Return the Erlang pid representing the service.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_async-3">send_async/3</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_async-4">send_async/4</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_async-5">send_async/5</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_async-6">send_async/6</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_async-7">send_async/7</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_async_active-3">send_async_active/3</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
The response is sent to the service as an Erlang message which is either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></td></tr>
<tr><td valign="top"><a href="#send_async_active-4">send_async_active/4</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
The response is sent to the service as an Erlang message which is either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></td></tr>
<tr><td valign="top"><a href="#send_async_active-5">send_async_active/5</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
The response is sent to the service as an Erlang message which is either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></td></tr>
<tr><td valign="top"><a href="#send_async_active-6">send_async_active/6</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
The response is sent to the service as an Erlang message which is either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></td></tr>
<tr><td valign="top"><a href="#send_async_active-7">send_async_active/7</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
The response is sent to the service as an Erlang message which is either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></td></tr>
<tr><td valign="top"><a href="#send_async_active-8">send_async_active/8</a></td><td>
<h4><a name="Send_an_asynchronous_service_request_with_a_previously_generated_transaction_id.">Send an asynchronous service request with a previously generated transaction id.</a></h4>
Only meant for special transaction handling.</td></tr>
<tr><td valign="top"><a href="#send_async_passive-3">send_async_passive/3</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
An alias for send_async.</td></tr>
<tr><td valign="top"><a href="#send_async_passive-4">send_async_passive/4</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
An alias for send_async.</td></tr>
<tr><td valign="top"><a href="#send_async_passive-5">send_async_passive/5</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
An alias for send_async.</td></tr>
<tr><td valign="top"><a href="#send_async_passive-6">send_async_passive/6</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
An alias for send_async.</td></tr>
<tr><td valign="top"><a href="#send_async_passive-7">send_async_passive/7</a></td><td>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
An alias for send_async.</td></tr>
<tr><td valign="top"><a href="#send_sync-3">send_sync/3</a></td><td>
<h4><a name="Send_a_synchronous_service_request.">Send a synchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_sync-4">send_sync/4</a></td><td>
<h4><a name="Send_a_synchronous_service_request.">Send a synchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_sync-5">send_sync/5</a></td><td>
<h4><a name="Send_a_synchronous_service_request.">Send a synchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_sync-6">send_sync/6</a></td><td>
<h4><a name="Send_a_synchronous_service_request.">Send a synchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#send_sync-7">send_sync/7</a></td><td>
<h4><a name="Send_a_synchronous_service_request.">Send a synchronous service request.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#source_subscriptions-2">source_subscriptions/2</a></td><td>
<h4><a name="Get_a_list_of_all_service_name_patterns_a_service_request_source_is_subscribed_to.">Get a list of all service name patterns a service request source is subscribed to.</a></h4><p>
The source pid can be found at:</p>
<code>cloudi_service_handle_request(_, _, _, _, _, _, _, _, Pid, _, _)</code></td></tr>
<tr><td valign="top"><a href="#subscribe-2">subscribe/2</a></td><td>
<h4><a name="Subscribe_to_a_service_name_pattern.">Subscribe to a service name pattern.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#subscribe_count-2">subscribe_count/2</a></td><td>
<h4><a name="Determine_how_may_service_name_pattern_subscriptions_have_occurred.">Determine how may service name pattern subscriptions have occurred.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#suffix-2">suffix/2</a></td><td>
<h4><a name="Service_request_suffix_from_a_service_name_or_service_name_pattern.">Service request suffix from a service name or service name pattern.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#timeout_async-1">timeout_async/1</a></td><td>
<h4><a name="Configured_service_default_asynchronous_timeout_(in_milliseconds).">Configured service default asynchronous timeout (in milliseconds).</a></h4>.</td></tr>
<tr><td valign="top"><a href="#timeout_max-1">timeout_max/1</a></td><td>
<h4><a name="Maximum_possible_service_request_timeout_(in_milliseconds).">Maximum possible service request timeout (in milliseconds).</a></h4>.</td></tr>
<tr><td valign="top"><a href="#timeout_sync-1">timeout_sync/1</a></td><td>
<h4><a name="Configured_service_default_synchronous_timeout_(in_milliseconds).">Configured service default synchronous timeout (in milliseconds).</a></h4>.</td></tr>
<tr><td valign="top"><a href="#trans_id-1">trans_id/1</a></td><td>
<h4><a name="Return_a_new_transaction_id.">Return a new transaction id.</a></h4>
The same data as used when sending service requests is used.</td></tr>
<tr><td valign="top"><a href="#unsubscribe-2">unsubscribe/2</a></td><td>
<h4><a name="Unsubscribe_from_a_service_name_pattern.">Unsubscribe from a service name pattern.</a></h4>.</td></tr>
</table>
<h2><a name="functions">Function Details</a></h2>
<h3 class="function"><a name="context_options-1">context_options/1</a></h3>
<div class="spec">
<p><tt>context_options(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> <a href="cloudi.html#type-options">cloudi:options()</a></tt><br></p>
</div><p>
<h4><a name="Get_the_context_options_from_the_service's_configuration.">Get the context options from the service's configuration.</a></h4>
A service would only use this when delaying the creation of a context
for child processes.</p>
<h3 class="function"><a name="demonitor-2">demonitor/2</a></h3>
<div class="spec">
<p><tt>demonitor(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, MonitorRef::reference()) -> true</tt><br></p>
</div><p>
<h4><a name="Demonitor_an_Erlang_pid.">Demonitor an Erlang pid.</a></h4>
The function will make sure an Erlang pid is demonitored properly.</p>
<h3 class="function"><a name="demonitor-3">demonitor/3</a></h3>
<div class="spec">
<p><tt>demonitor(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, MonitorRef::reference(), Options::list()) -> true</tt><br></p>
</div><p>
<h4><a name="Demonitor_an_Erlang_pid_with_options.">Demonitor an Erlang pid with options.</a></h4>
The function will make sure an Erlang pid is demonitored properly.</p>
<h3 class="function"><a name="destination_refresh_immediate-1">destination_refresh_immediate/1</a></h3>
<div class="spec">
<p><tt>destination_refresh_immediate(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> boolean()</tt><br></p>
</div><p>
<h4><a name="Configured_service_destination_refresh_is_immediate.">Configured service destination refresh is immediate.</a></h4>
</p>
<h3 class="function"><a name="destination_refresh_lazy-1">destination_refresh_lazy/1</a></h3>
<div class="spec">
<p><tt>destination_refresh_lazy(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> boolean()</tt><br></p>
</div><p>
<h4><a name="Configured_service_destination_refresh_is_lazy.">Configured service destination refresh is lazy.</a></h4>
</p>
<h3 class="function"><a name="dispatcher-1">dispatcher/1</a></h3>
<div class="spec">
<p><tt>dispatcher(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> NewDispatcher::pid()</tt><br></p>
</div><p>
<h4><a name="Return_the_Erlang_pid_representing_the_service_sender.">Return the Erlang pid representing the service sender.</a></h4>
Use when the Dispatcher is stored and used after the current
cloudi_service callback has returned. This is only necessary when
storing the dispatcher within the cloudi_service_init/3 callback,
for use in a different callback.</p>
<h3 class="function"><a name="duo_mode-1">duo_mode/1</a></h3>
<div class="spec">
<p><tt>duo_mode(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> boolean()</tt><br></p>
</div><p>
<h4><a name="Determine_if_duo_mode_is_enabled.">Determine if duo_mode is enabled.</a></h4>
</p>
<h3 class="function"><a name="forward-9">forward/9</a></h3>
<div class="spec">
<p><tt>forward(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Type::<a href="#type-request_type">request_type()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_value_milliseconds">timeout_value_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>, TransId::<a href="#type-trans_id">trans_id()</a>, Pid::pid()) -> no_return()</tt><br></p>
</div><p>
<h4><a name="Forward_a_service_request.">Forward a service request.</a></h4>
</p>
<h3 class="function"><a name="forward_async-8">forward_async/8</a></h3>
<div class="spec">
<p><tt>forward_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_value_milliseconds">timeout_value_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>, TransId::<a href="#type-trans_id">trans_id()</a>, Pid::pid()) -> no_return()</tt><br></p>
</div><p>
<h4><a name="Forward_an_asynchronous_service_request.">Forward an asynchronous service request.</a></h4>
</p>
<h3 class="function"><a name="forward_sync-8">forward_sync/8</a></h3>
<div class="spec">
<p><tt>forward_sync(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_value_milliseconds">timeout_value_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>, TransId::<a href="#type-trans_id">trans_id()</a>, Pid::pid()) -> no_return()</tt><br></p>
</div><p>
<h4><a name="Forward_a_synchronous_service_request.">Forward a synchronous service request.</a></h4>
</p>
<h3 class="function"><a name="get_pid-2">get_pid/2</a></h3>
<div class="spec">
<p><tt>get_pid(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>) -> {ok, PatternPid::<a href="#type-pattern_pid">pattern_pid()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Get_a_service_destination_based_on_a_service_name.">Get a service destination based on a service name.</a></h4>
</p>
<h3 class="function"><a name="get_pid-3">get_pid/3</a></h3>
<div class="spec">
<p><tt>get_pid(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>) -> {ok, PatternPid::<a href="#type-pattern_pid">pattern_pid()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Get_a_service_destination_based_on_a_service_name.">Get a service destination based on a service name.</a></h4>
</p>
<h3 class="function"><a name="get_pids-2">get_pids/2</a></h3>
<div class="spec">
<p><tt>get_pids(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>) -> {ok, PatternPids::[<a href="#type-pattern_pid">pattern_pid()</a>]} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Get_all_service_destinations_based_on_a_service_name.">Get all service destinations based on a service name.</a></h4>
</p>
<h3 class="function"><a name="get_pids-3">get_pids/3</a></h3>
<div class="spec">
<p><tt>get_pids(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>) -> {ok, PatternPids::[<a href="#type-pattern_pid">pattern_pid()</a>]} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Get_a_service_destination_based_on_a_service_name.">Get a service destination based on a service name.</a></h4>
</p>
<h3 class="function"><a name="mcast_async-3">mcast_async/3</a></h3>
<div class="spec">
<p><tt>mcast_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>) -> {ok, TransIdList::[<a href="#type-trans_id">trans_id()</a>]} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
Asynchronous service requests are sent to all services that have
subscribed to the service name pattern that matches the destination.</p>
<h3 class="function"><a name="mcast_async-4">mcast_async/4</a></h3>
<div class="spec">
<p><tt>mcast_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>) -> {ok, TransIdList::[<a href="#type-trans_id">trans_id()</a>]} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
Asynchronous service requests are sent to all services that have
subscribed to the service name pattern that matches the destination.</p>
<h3 class="function"><a name="mcast_async-6">mcast_async/6</a></h3>
<div class="spec">
<p><tt>mcast_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>) -> {ok, TransIdList::[<a href="#type-trans_id">trans_id()</a>]} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
Asynchronous service requests are sent to all services that have
subscribed to the service name pattern that matches the destination.</p>
<h3 class="function"><a name="mcast_async_active-3">mcast_async_active/3</a></h3>
<div class="spec">
<p><tt>mcast_async_active(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>) -> {ok, TransIdList::[<a href="#type-trans_id">trans_id()</a>]} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
Asynchronous service requests are sent to all services that have
subscribed to the service name pattern that matches the destination.
The responses are sent to the service as Erlang messages that are either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></p>
<h3 class="function"><a name="mcast_async_active-4">mcast_async_active/4</a></h3>
<div class="spec">
<p><tt>mcast_async_active(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>) -> {ok, TransIdList::[<a href="#type-trans_id">trans_id()</a>]} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
Asynchronous service requests are sent to all services that have
subscribed to the service name pattern that matches the destination.
The responses are sent to the service as Erlang messages that are either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></p>
<h3 class="function"><a name="mcast_async_active-6">mcast_async_active/6</a></h3>
<div class="spec">
<p><tt>mcast_async_active(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>) -> {ok, TransIdList::[<a href="#type-trans_id">trans_id()</a>]} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
Asynchronous service requests are sent to all services that have
subscribed to the service name pattern that matches the destination.
The responses are sent to the service as Erlang messages that are either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></p>
<h3 class="function"><a name="mcast_async_passive-3">mcast_async_passive/3</a></h3>
<div class="spec">
<p><tt>mcast_async_passive(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>) -> {ok, TransIdList::[<a href="#type-trans_id">trans_id()</a>]} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
An alias for mcast_async. The asynchronous service requests are returned
and handled the same way as within external services.</p>
<h3 class="function"><a name="mcast_async_passive-4">mcast_async_passive/4</a></h3>
<div class="spec">
<p><tt>mcast_async_passive(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>) -> {ok, TransIdList::[<a href="#type-trans_id">trans_id()</a>]} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
An alias for mcast_async. The asynchronous service requests are returned
and handled the same way as within external services.</p>
<h3 class="function"><a name="mcast_async_passive-6">mcast_async_passive/6</a></h3>
<div class="spec">
<p><tt>mcast_async_passive(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>) -> {ok, TransIdList::[<a href="#type-trans_id">trans_id()</a>]} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_multicast_asynchronous_service_request.">Send a multicast asynchronous service request.</a></h4>
An alias for mcast_async. The asynchronous service requests are returned
and handled the same way as within external services.</p>
<h3 class="function"><a name="monitor-2">monitor/2</a></h3>
<div class="spec">
<p><tt>monitor(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Pid::pid()) -> MonitorRef::reference()</tt><br></p>
</div><p>
<h4><a name="Monitor_an_Erlang_pid.">Monitor an Erlang pid.</a></h4>
The function will make sure an Erlang pid is monitored properly so the
cloudi_service_handle_info/3 callback receives the monitor result.
Since both the request_pid and the info_pid are temporary Erlang processes,
no spawned Erlang process should be linked to the request_pid or info_pid.</p>
<h3 class="function"><a name="prefix-1">prefix/1</a></h3>
<div class="spec">
<p><tt>prefix(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> Prefix::<a href="#type-service_name_pattern">service_name_pattern()</a></tt><br></p>
</div><p>
<h4><a name="Configured_service_default_prefix.">Configured service default prefix.</a></h4>
All subscribed/unsubscribed service names use this prefix. The prefix
defines the scope of the service.</p>
<h3 class="function"><a name="priority_default-1">priority_default/1</a></h3>
<div class="spec">
<p><tt>priority_default(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> PriorityDefault::<a href="cloudi_service_api.html#type-priority">cloudi_service_api:priority()</a></tt><br></p>
</div><p>
<h4><a name="Configured_service_default_priority.">Configured service default priority.</a></h4>
</p>
<h3 class="function"><a name="process_count-1">process_count/1</a></h3>
<div class="spec">
<p><tt>process_count(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> ProcessCount::pos_integer()</tt><br></p>
</div><p>
<h4><a name="Return_the_initial_process_count_of_this_instance_of_the_service.">Return the initial process count of this instance of the service.</a></h4>
The configuration of the service defined how many instances should exist.</p>
<h3 class="function"><a name="process_count_max-1">process_count_max/1</a></h3>
<div class="spec">
<p><tt>process_count_max(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> ProcessCountMax::pos_integer()</tt><br></p>
</div><p>
<h4><a name="Return_the_process_count_maximum_of_this_instance_of_the_service.">Return the process count maximum of this instance of the service.</a></h4>
This will be the same as the process_count, unless count_process_dynamic
configuration provides a maximum that is greater than the process_count.</p>
<h3 class="function"><a name="process_count_min-1">process_count_min/1</a></h3>
<div class="spec">
<p><tt>process_count_min(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> ProcessCountMin::pos_integer()</tt><br></p>
</div><p>
<h4><a name="Return_the_process_count_minimum_of_this_instance_of_the_service.">Return the process count minimum of this instance of the service.</a></h4>
This will be the same as the process_count, unless count_process_dynamic
configuration provides a minimum that is less than the process_count.</p>
<h3 class="function"><a name="process_index-1">process_index/1</a></h3>
<div class="spec">
<p><tt>process_index(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> ProcessIndex::non_neg_integer()</tt><br></p>
</div><p>
<h4><a name="Return_the_0-based_index_of_this_instance_of_the_service.">Return the 0-based index of this instance of the service.</a></h4>
The configuration of the service defined how many instances should exist.</p>
<h3 class="function"><a name="recv_async-1">recv_async/1</a></h3>
<div class="spec">
<p><tt>recv_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> {ok, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}</tt><br></p>
</div><p>
<h4><a name="Receive_an_asynchronous_service_request.">Receive an asynchronous service request.</a></h4>
Use a null TransId to receive the oldest service request.</p>
<h3 class="function"><a name="recv_async-2">recv_async/2</a></h3>
<div class="spec">
<p><tt>recv_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, TransId::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a> | <a href="#type-trans_id">trans_id()</a>) -> {ok, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}</tt><br></p>
</div><p>
<h4><a name="Receive_an_asynchronous_service_request.">Receive an asynchronous service request.</a></h4>
Either use the supplied TransId to receive the specific service request
or use a null TransId to receive the oldest service request.</p>
<h3 class="function"><a name="recv_async-3">recv_async/3</a></h3>
<div class="spec">
<p><tt>recv_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a> | <a href="#type-trans_id">trans_id()</a>, TransId::<a href="#type-trans_id">trans_id()</a> | boolean()) -> {ok, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}</tt><br></p>
</div><p>
<h4><a name="Receive_an_asynchronous_service_request.">Receive an asynchronous service request.</a></h4>
Either use the supplied TransId to receive the specific service request
or use a null TransId to receive the oldest service request.</p>
<h3 class="function"><a name="recv_async-4">recv_async/4</a></h3>
<div class="spec">
<p><tt>recv_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, TransId::<a href="#type-trans_id">trans_id()</a>, Consume::boolean()) -> {ok, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}</tt><br></p>
</div><p>
<h4><a name="Receive_an_asynchronous_service_request.">Receive an asynchronous service request.</a></h4>
</p>
<h3 class="function"><a name="recv_asyncs-2">recv_asyncs/2</a></h3>
<div class="spec">
<p><tt>recv_asyncs(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, TransIdList::[<a href="#type-trans_id">trans_id()</a>]) -> {ok, [{ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>, TransId::<a href="#type-trans_id">trans_id()</a>}]} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}</tt><br></p>
</div><p>
<h4><a name="Receive_asynchronous_service_requests.">Receive asynchronous service requests.</a></h4>
</p>
<h3 class="function"><a name="recv_asyncs-3">recv_asyncs/3</a></h3>
<div class="spec">
<p><tt>recv_asyncs(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, TransIdList::[<a href="#type-trans_id">trans_id()</a>]) -> {ok, [{ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>, TransId::<a href="#type-trans_id">trans_id()</a>}]} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}</tt><br></p>
</div><p>
<h4><a name="Receive_asynchronous_service_requests.">Receive asynchronous service requests.</a></h4>
</p>
<h3 class="function"><a name="recv_asyncs-4">recv_asyncs/4</a></h3>
<div class="spec">
<p><tt>recv_asyncs(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, TransIdList::[<a href="#type-trans_id">trans_id()</a>], Consume::boolean()) -> {ok, [{ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>, TransId::<a href="#type-trans_id">trans_id()</a>}]} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}</tt><br></p>
</div><p>
<h4><a name="Receive_asynchronous_service_requests.">Receive asynchronous service requests.</a></h4>
</p>
<h3 class="function"><a name="return-2">return/2</a></h3>
<div class="spec">
<p><tt>return(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Response::<a href="#type-response">response()</a>) -> no_return()</tt><br></p>
</div><p>
<h4><a name="Return_a_service_response.">Return a service response.</a></h4>
</p>
<h3 class="function"><a name="return-3">return/3</a></h3>
<div class="spec">
<p><tt>return(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>) -> no_return()</tt><br></p>
</div><p>
<h4><a name="Return_a_service_response.">Return a service response.</a></h4>
</p>
<h3 class="function"><a name="return-9">return/9</a></h3>
<div class="spec">
<p><tt>return(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Type::<a href="#type-request_type">request_type()</a>, Name::<a href="#type-service_name">service_name()</a>, Pattern::<a href="#type-service_name_pattern">service_name_pattern()</a>, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>, Timeout::<a href="#type-timeout_value_milliseconds">timeout_value_milliseconds()</a>, TransId::<a href="#type-trans_id">trans_id()</a>, Pid::pid()) -> no_return()</tt><br></p>
</div><p>
<h4><a name="Return_a_service_response.">Return a service response.</a></h4>
</p>
<h3 class="function"><a name="return_async-8">return_async/8</a></h3>
<div class="spec">
<p><tt>return_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Pattern::<a href="#type-service_name_pattern">service_name_pattern()</a>, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>, Timeout::<a href="#type-timeout_value_milliseconds">timeout_value_milliseconds()</a>, TransId::<a href="#type-trans_id">trans_id()</a>, Pid::pid()) -> no_return()</tt><br></p>
</div><p>
<h4><a name="Return_an_asynchronous_service_response.">Return an asynchronous service response.</a></h4>
</p>
<h3 class="function"><a name="return_nothrow-9">return_nothrow/9</a></h3>
<div class="spec">
<p><tt>return_nothrow(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Type::<a href="#type-request_type">request_type()</a>, Name::<a href="#type-service_name">service_name()</a>, Pattern::<a href="#type-service_name_pattern">service_name_pattern()</a>, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>, Timeout::<a href="#type-timeout_value_milliseconds">timeout_value_milliseconds()</a>, TransId::<a href="#type-trans_id">trans_id()</a>, Pid::pid()) -> ok</tt><br></p>
</div><p>
<h4><a name="Return_a_service_response_without_exiting_the_request_handler.">Return a service response without exiting the request handler.</a></h4>
Should rarely, if ever, be used. If the service has the option
request_timeout_adjustment == true, the adjustment will not occur when
this function is used. Also, the service's
response_timeout_immediate_max option will not prevent a null response
from being sent when this function is used.</p>
<h3 class="function"><a name="return_sync-8">return_sync/8</a></h3>
<div class="spec">
<p><tt>return_sync(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Pattern::<a href="#type-service_name_pattern">service_name_pattern()</a>, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>, Timeout::<a href="#type-timeout_value_milliseconds">timeout_value_milliseconds()</a>, TransId::<a href="#type-trans_id">trans_id()</a>, Pid::pid()) -> no_return()</tt><br></p>
</div><p>
<h4><a name="Return_a_synchronous_service_response.">Return a synchronous service response.</a></h4>
</p>
<h3 class="function"><a name="self-1">self/1</a></h3>
<div class="spec">
<p><tt>self(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> Self::<a href="#type-source">source()</a></tt><br></p>
</div><p>
<h4><a name="Return_the_Erlang_pid_representing_the_service.">Return the Erlang pid representing the service.</a></h4>
</p>
<h3 class="function"><a name="send_async-3">send_async/3</a></h3>
<div class="spec">
<p><tt>send_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
</p>
<h3 class="function"><a name="send_async-4">send_async/4</a></h3>
<div class="spec">
<p><tt>send_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
</p>
<h3 class="function"><a name="send_async-5">send_async/5</a></h3>
<div class="spec">
<p><tt>send_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, PatternPid::<a href="#type-pattern_pid">pattern_pid()</a> | undefined) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
</p>
<h3 class="function"><a name="send_async-6">send_async/6</a></h3>
<div class="spec">
<p><tt>send_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
</p>
<h3 class="function"><a name="send_async-7">send_async/7</a></h3>
<div class="spec">
<p><tt>send_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>, PatternPid::<a href="#type-pattern_pid">pattern_pid()</a> | undefined) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
</p>
<h3 class="function"><a name="send_async_active-3">send_async_active/3</a></h3>
<div class="spec">
<p><tt>send_async_active(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
The response is sent to the service as an Erlang message which is either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></p>
<h3 class="function"><a name="send_async_active-4">send_async_active/4</a></h3>
<div class="spec">
<p><tt>send_async_active(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
The response is sent to the service as an Erlang message which is either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></p>
<h3 class="function"><a name="send_async_active-5">send_async_active/5</a></h3>
<div class="spec">
<p><tt>send_async_active(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, PatternPid::<a href="#type-pattern_pid">pattern_pid()</a> | undefined) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
The response is sent to the service as an Erlang message which is either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></p>
<h3 class="function"><a name="send_async_active-6">send_async_active/6</a></h3>
<div class="spec">
<p><tt>send_async_active(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
The response is sent to the service as an Erlang message which is either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></p>
<h3 class="function"><a name="send_async_active-7">send_async_active/7</a></h3>
<div class="spec">
<p><tt>send_async_active(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>, PatternPid::<a href="#type-pattern_pid">pattern_pid()</a> | undefined) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
The response is sent to the service as an Erlang message which is either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></p>
<h3 class="function"><a name="send_async_active-8">send_async_active/8</a></h3>
<div class="spec">
<p><tt>send_async_active(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>, TransId::<a href="#type-trans_id">trans_id()</a>, PatternPid::<a href="#type-pattern_pid">pattern_pid()</a>) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request_with_a_previously_generated_transaction_id.">Send an asynchronous service request with a previously generated transaction id.</a></h4>
Only meant for special transaction handling.
The response is sent to the service as an Erlang message which is either:
<code>{return_async_active, Name, Pattern, ResponseInfo, Response, Timeout, TransId}</code>
(or)
<code>{timeout_async_active, TransId}</code>
use <code>-include_lib("cloudi_core/include/cloudi_service.hrl").</code> to have:
<code>#return_async_active{}</code> (or) <code>#timeout_async_active{}</code></p>
<h3 class="function"><a name="send_async_passive-3">send_async_passive/3</a></h3>
<div class="spec">
<p><tt>send_async_passive(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
An alias for send_async. The asynchronous service request is returned
and handled the same way as within external services.</p>
<h3 class="function"><a name="send_async_passive-4">send_async_passive/4</a></h3>
<div class="spec">
<p><tt>send_async_passive(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
An alias for send_async. The asynchronous service request is returned
and handled the same way as within external services.</p>
<h3 class="function"><a name="send_async_passive-5">send_async_passive/5</a></h3>
<div class="spec">
<p><tt>send_async_passive(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, PatternPid::<a href="#type-pattern_pid">pattern_pid()</a> | undefined) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
An alias for send_async. The asynchronous service request is returned
and handled the same way as within external services.</p>
<h3 class="function"><a name="send_async_passive-6">send_async_passive/6</a></h3>
<div class="spec">
<p><tt>send_async_passive(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
An alias for send_async. The asynchronous service request is returned
and handled the same way as within external services.</p>
<h3 class="function"><a name="send_async_passive-7">send_async_passive/7</a></h3>
<div class="spec">
<p><tt>send_async_passive(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>, PatternPid::<a href="#type-pattern_pid">pattern_pid()</a> | undefined) -> {ok, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason">error_reason()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_an_asynchronous_service_request.">Send an asynchronous service request.</a></h4>
An alias for send_async. The asynchronous service request is returned
and handled the same way as within external services.</p>
<h3 class="function"><a name="send_sync-3">send_sync/3</a></h3>
<div class="spec">
<p><tt>send_sync(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>) -> {ok, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>} | {ok, Response::<a href="#type-response">response()</a>} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_synchronous_service_request.">Send a synchronous service request.</a></h4>
</p>
<h3 class="function"><a name="send_sync-4">send_sync/4</a></h3>
<div class="spec">
<p><tt>send_sync(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>) -> {ok, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>} | {ok, Response::<a href="#type-response">response()</a>} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_synchronous_service_request.">Send a synchronous service request.</a></h4>
</p>
<h3 class="function"><a name="send_sync-5">send_sync/5</a></h3>
<div class="spec">
<p><tt>send_sync(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, PatternPid::<a href="#type-pattern_pid">pattern_pid()</a> | undefined) -> {ok, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>} | {ok, Response::<a href="#type-response">response()</a>} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_synchronous_service_request.">Send a synchronous service request.</a></h4>
</p>
<h3 class="function"><a name="send_sync-6">send_sync/6</a></h3>
<div class="spec">
<p><tt>send_sync(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>) -> {ok, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>} | {ok, Response::<a href="#type-response">response()</a>} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_synchronous_service_request.">Send a synchronous service request.</a></h4>
</p>
<h3 class="function"><a name="send_sync-7">send_sync/7</a></h3>
<div class="spec">
<p><tt>send_sync(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Name::<a href="#type-service_name">service_name()</a>, RequestInfo::<a href="#type-request_info">request_info()</a>, Request::<a href="#type-request">request()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, Priority::<a href="#type-priority">priority()</a>, PatternPid::<a href="#type-pattern_pid">pattern_pid()</a> | undefined) -> {ok, ResponseInfo::<a href="#type-response_info">response_info()</a>, Response::<a href="#type-response">response()</a>} | {ok, Response::<a href="#type-response">response()</a>} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}</tt><br></p>
</div><p>
<h4><a name="Send_a_synchronous_service_request.">Send a synchronous service request.</a></h4>
</p>
<h3 class="function"><a name="source_subscriptions-2">source_subscriptions/2</a></h3>
<div class="spec">
<p><tt>source_subscriptions(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Pid::<a href="#type-source">source()</a>) -> [<a href="#type-service_name_pattern">service_name_pattern()</a>]</tt><br></p>
</div><p>
<h4><a name="Get_a_list_of_all_service_name_patterns_a_service_request_source_is_subscribed_to.">Get a list of all service name patterns a service request source is subscribed to.</a></h4><p>
The source pid can be found at:</p>
<code>cloudi_service_handle_request(_, _, _, _, _, _, _, _, Pid, _, _)</code></p>
<h3 class="function"><a name="subscribe-2">subscribe/2</a></h3>
<div class="spec">
<p><tt>subscribe(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Pattern::<a href="#type-service_name_pattern_suffix">service_name_pattern_suffix()</a>) -> ok | error</tt><br></p>
</div><p>
<h4><a name="Subscribe_to_a_service_name_pattern.">Subscribe to a service name pattern.</a></h4>
</p>
<h3 class="function"><a name="subscribe_count-2">subscribe_count/2</a></h3>
<div class="spec">
<p><tt>subscribe_count(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Pattern::<a href="#type-service_name_pattern_suffix">service_name_pattern_suffix()</a>) -> non_neg_integer()</tt><br></p>
</div><p>
<h4><a name="Determine_how_may_service_name_pattern_subscriptions_have_occurred.">Determine how may service name pattern subscriptions have occurred.</a></h4>
</p>
<h3 class="function"><a name="suffix-2">suffix/2</a></h3>
<div class="spec">
<p><tt>suffix(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, NameOrPattern::<a href="#type-service_name">service_name()</a> | <a href="#type-service_name_pattern">service_name_pattern()</a>) -> Suffix::<a href="#type-service_name">service_name()</a> | <a href="#type-service_name_pattern">service_name_pattern()</a></tt><br></p>
</div><p>
<h4><a name="Service_request_suffix_from_a_service_name_or_service_name_pattern.">Service request suffix from a service name or service name pattern.</a></h4>
</p>
<h3 class="function"><a name="timeout_async-1">timeout_async/1</a></h3>
<div class="spec">
<p><tt>timeout_async(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> TimeoutAsync::<a href="cloudi_service_api.html#type-timeout_send_async_value_milliseconds">cloudi_service_api:timeout_send_async_value_milliseconds()</a></tt><br></p>
</div><p>
<h4><a name="Configured_service_default_asynchronous_timeout_(in_milliseconds).">Configured service default asynchronous timeout (in milliseconds).</a></h4>
</p>
<h3 class="function"><a name="timeout_max-1">timeout_max/1</a></h3>
<div class="spec">
<p><tt>timeout_max(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> TimeoutMax::pos_integer()</tt><br></p>
</div><p>
<h4><a name="Maximum_possible_service_request_timeout_(in_milliseconds).">Maximum possible service request timeout (in milliseconds).</a></h4>
</p>
<h3 class="function"><a name="timeout_sync-1">timeout_sync/1</a></h3>
<div class="spec">
<p><tt>timeout_sync(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> TimeoutSync::<a href="cloudi_service_api.html#type-timeout_send_sync_value_milliseconds">cloudi_service_api:timeout_send_sync_value_milliseconds()</a></tt><br></p>
</div><p>
<h4><a name="Configured_service_default_synchronous_timeout_(in_milliseconds).">Configured service default synchronous timeout (in milliseconds).</a></h4>
</p>
<h3 class="function"><a name="trans_id-1">trans_id/1</a></h3>
<div class="spec">
<p><tt>trans_id(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>) -> <a href="#type-trans_id">trans_id()</a></tt><br></p>
</div><p>
<h4><a name="Return_a_new_transaction_id.">Return a new transaction id.</a></h4>
The same data as used when sending service requests is used.</p>
<h3 class="function"><a name="unsubscribe-2">unsubscribe/2</a></h3>
<div class="spec">
<p><tt>unsubscribe(Dispatcher::<a href="#type-dispatcher">dispatcher()</a>, Pattern::<a href="#type-service_name_pattern_suffix">service_name_pattern_suffix()</a>) -> ok | error</tt><br></p>
</div><p>
<h4><a name="Unsubscribe_from_a_service_name_pattern.">Unsubscribe from a service name pattern.</a></h4>
</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, Sep 12 2017, 17:11:52.</i></p>
</body>
</html>