Current section
Files
Jump to
Current section
Files
doc/cloudi.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</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</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_Erlang_Interface">CloudI Erlang Interface</a></h3>.
<p>Copyright © 2013-2017 Michael Truog</p>
<p><b>Version:</b> 1.7.1 Dec 17 2018 18:07:35
------------------------------------------------------------------------</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_Erlang_Interface">CloudI Erlang Interface</a></h3>
<h2><a name="types">Data Types</a></h2>
<h3 class="typedecl"><a name="type-agent">agent()</a></h3>
<p><tt>agent() = <a href="#type-context">context()</a> | <a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a></tt></p>
<h3 class="typedecl"><a name="type-context">context()</a></h3>
<p><tt>context() = #cloudi_context{dest_refresh = <a href="cloudi_service_api.html#type-dest_refresh">cloudi_service_api:dest_refresh()</a>, dest_refresh_delay = <a href="cloudi_service_api.html#type-dest_refresh_delay_milliseconds">cloudi_service_api:dest_refresh_delay_milliseconds()</a>, request_name_lookup = sync | async, timeout_async = <a href="cloudi_service_api.html#type-timeout_send_async_value_milliseconds">cloudi_service_api:timeout_send_async_value_milliseconds()</a>, timeout_sync = <a href="cloudi_service_api.html#type-timeout_send_sync_value_milliseconds">cloudi_service_api:timeout_send_sync_value_milliseconds()</a>, priority_default = <a href="cloudi_service_api.html#type-priority">cloudi_service_api:priority()</a>, scope = atom(), receiver = pid(), uuid_generator = <a href="deps/uuid/doc/uuid.html#type-state">uuid:state()</a>, cpg_data = <a href="deps/cpg/doc/cpg_data.html#type-state">cpg_data:state()</a>, cpg_data_stale = boolean()}</tt></p>
<h3 class="typedecl"><a name="type-dest_refresh_delay_milliseconds">dest_refresh_delay_milliseconds()</a></h3>
<p><tt>dest_refresh_delay_milliseconds() = 0..4294967295</tt></p>
<h3 class="typedecl"><a name="type-dispatcher">dispatcher()</a></h3>
<p><tt>dispatcher() = <a href="cloudi_service.html#type-dispatcher">cloudi_service:dispatcher()</a></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> | <a href="cloudi_service.html#type-error_reason_sync">cloudi_service:error_reason_sync()</a></tt></p>
<h3 class="typedecl"><a name="type-message_service_request">message_service_request()</a></h3>
<p><tt>message_service_request() = {Type::cloudi_service_send_async | cloudi_service_send_sync, Name::<a href="#type-service_name">service_name()</a>, Pattern::<a href="#type-service_name_pattern">service_name_pattern()</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_value">priority_value()</a>, TransId::<a href="#type-trans_id">trans_id()</a>, Source::pid()}</tt></p>
<h3 class="typedecl"><a name="type-message_service_response">message_service_response()</a></h3>
<p><tt>message_service_response() = {Type::cloudi_service_return_async | cloudi_service_return_sync, 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>, Source::pid()}</tt></p>
<h3 class="typedecl"><a name="type-options">options()</a></h3>
<p><tt>options() = [{dest_refresh, <a href="cloudi_service_api.html#type-dest_refresh">cloudi_service_api:dest_refresh()</a>} | {dest_refresh_start, <a href="#type-dest_refresh_delay_milliseconds">dest_refresh_delay_milliseconds()</a>} | {dest_refresh_delay, <a href="cloudi_service_api.html#type-dest_refresh_delay_milliseconds">cloudi_service_api:dest_refresh_delay_milliseconds()</a>} | {request_name_lookup, sync | async} | {timeout_async, <a href="cloudi_service_api.html#type-timeout_send_async_value_milliseconds">cloudi_service_api:timeout_send_async_value_milliseconds()</a>} | {timeout_sync, <a href="cloudi_service_api.html#type-timeout_send_sync_value_milliseconds">cloudi_service_api:timeout_send_sync_value_milliseconds()</a>} | {priority_default, <a href="#type-priority">priority()</a>} | {scope, atom()} | {uuid, <a href="deps/uuid/doc/uuid.html#type-state">uuid:state()</a>} | {groups, <a href="deps/cpg/doc/cpg_data.html#type-state">cpg_data:state()</a>} | {groups_scope, atom()} | {groups_static, boolean()}]</tt></p>
<h3 class="typedecl"><a name="type-pattern_pid">pattern_pid()</a></h3>
<p><tt>pattern_pid() = {<a href="#type-service_name_pattern">service_name_pattern()</a>, pid()}</tt></p>
<h3 class="typedecl"><a name="type-priority">priority()</a></h3>
<p><tt>priority() = <a href="#type-priority_value">priority_value()</a> | undefined</tt></p>
<h3 class="typedecl"><a name="type-priority_value">priority_value()</a></h3>
<p><tt>priority_value() = <a href="cloudi_service_api.html#type-priority">cloudi_service_api:priority()</a></tt></p>
<h3 class="typedecl"><a name="type-request">request()</a></h3>
<p><tt>request() = any()</tt></p>
<h3 class="typedecl"><a name="type-request_info">request_info()</a></h3>
<p><tt>request_info() = any()</tt></p>
<h3 class="typedecl"><a name="type-request_type">request_type()</a></h3>
<p><tt>request_type() = <a href="cloudi_service.html#type-request_type">cloudi_service:request_type()</a></tt></p>
<h3 class="typedecl"><a name="type-response">response()</a></h3>
<p><tt>response() = any()</tt></p>
<h3 class="typedecl"><a name="type-response_info">response_info()</a></h3>
<p><tt>response_info() = any()</tt></p>
<h3 class="typedecl"><a name="type-service_name">service_name()</a></h3>
<p><tt>service_name() = nonempty_string()</tt></p>
<h3 class="typedecl"><a name="type-service_name_pattern">service_name_pattern()</a></h3>
<p><tt>service_name_pattern() = nonempty_string()</tt></p>
<h3 class="typedecl"><a name="type-service_name_pattern_suffix">service_name_pattern_suffix()</a></h3>
<p><tt>service_name_pattern_suffix() = string()</tt></p>
<h3 class="typedecl"><a name="type-timeout_milliseconds">timeout_milliseconds()</a></h3>
<p><tt>timeout_milliseconds() = <a href="#type-timeout_value_milliseconds">timeout_value_milliseconds()</a> | undefined | limit_min | limit_max | immediate</tt></p>
<h3 class="typedecl"><a name="type-timeout_value_milliseconds">timeout_value_milliseconds()</a></h3>
<p><tt>timeout_value_milliseconds() = 0..4294967195</tt></p>
<h3 class="typedecl"><a name="type-trans_id">trans_id()</a></h3>
<p><tt>trans_id() = <<_:128>></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="#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="#destinations_refresh-2">destinations_refresh/2</a></td><td>
<h4><a name="Refresh_destination_lookup_data.">Refresh destination lookup data.</a></h4>
Called when using a lazy destination refresh method.</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_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="#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_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="#new-0">new/0</a></td><td>
<h4><a name="Create_a_CloudI_context.">Create a CloudI context.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#new-1">new/1</a></td><td>
<h4><a name="Create_a_CloudI_context.">Create a CloudI context.</a></h4>
If a lazy destination refresh method is used, make sure to receive the
{cloudi_cpg_data, Groups} message and pass it to the
destinations_refresh/2 function.</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="#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_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="#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_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="#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="#trans_id_age-1">trans_id_age/1</a></td><td>
<h4><a name="Return_the_age_of_the_transaction_id.">Return the age of the transaction id.</a></h4>
The result is microseconds since the Unix epoch 1970-01-01 00:00:00.</td></tr>
</table>
<h2><a name="functions">Function Details</a></h2>
<h3 class="function"><a name="destination_refresh_immediate-1">destination_refresh_immediate/1</a></h3>
<div class="spec">
<p><tt>destination_refresh_immediate(Context::<a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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="destinations_refresh-2">destinations_refresh/2</a></h3>
<div class="spec">
<p><tt>destinations_refresh(Context::<a href="#type-context">context()</a>, Message::{cloudi_cpg_data, <a href="deps/cpg/doc/cpg_data.html#type-state">cpg_data:state()</a>}) -> <a href="#type-context">context()</a></tt><br></p>
</div><p>
<h4><a name="Refresh_destination_lookup_data.">Refresh destination lookup data.</a></h4>
Called when using a lazy destination refresh method.
The {cloudi_cpg_data, Groups} message is stored and processed
by this function. However, if it isn't processed, the other function
calls will update the Context based on any pending destination refresh
messages.</p>
<h3 class="function"><a name="get_pid-2">get_pid/2</a></h3>
<div class="spec">
<p><tt>get_pid(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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="mcast_async-3">mcast_async/3</a></h3>
<div class="spec">
<p><tt>mcast_async(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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_passive-3">mcast_async_passive/3</a></h3>
<div class="spec">
<p><tt>mcast_async_passive(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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="new-0">new/0</a></h3>
<div class="spec">
<p><tt>new() -> <a href="#type-context">context()</a></tt><br></p>
</div><p>
<h4><a name="Create_a_CloudI_context.">Create a CloudI context.</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-context">context()</a></tt><br></p>
</div><p>
<h4><a name="Create_a_CloudI_context.">Create a CloudI context.</a></h4>
If a lazy destination refresh method is used, make sure to receive the
{cloudi_cpg_data, Groups} message and pass it to the
destinations_refresh/2 function.</p>
<h3 class="function"><a name="priority_default-1">priority_default/1</a></h3>
<div class="spec">
<p><tt>priority_default(Context::<a href="#type-agent">agent()</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="recv_async-1">recv_async/1</a></h3>
<div class="spec">
<p><tt>recv_async(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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. Consume is
implicitly true.</p>
<h3 class="function"><a name="recv_async-2">recv_async/2</a></h3>
<div class="spec">
<p><tt>recv_async(Context::<a href="#type-agent">agent()</a>, TransId_Timeout::<a href="#type-trans_id">trans_id()</a> | <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>, TransId::<a href="#type-trans_id">trans_id()</a>} | {error, Reason::<a href="#type-error_reason_sync">error_reason_sync()</a>}, <a href="#type-agent">agent()</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. Consume is
implicitly true.</p>
<h3 class="function"><a name="recv_async-3">recv_async/3</a></h3>
<div class="spec">
<p><tt>recv_async(Context::<a href="#type-agent">agent()</a>, Timeout::<a href="#type-timeout_milliseconds">timeout_milliseconds()</a>, TransId::<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>}, <a href="#type-agent">agent()</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. Consume is
implicitly true.</p>
<h3 class="function"><a name="recv_asyncs-2">recv_asyncs/2</a></h3>
<div class="spec">
<p><tt>recv_asyncs(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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="send_async-3">send_async/3</a></h3>
<div class="spec">
<p><tt>send_async(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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_passive-3">send_async_passive/3</a></h3>
<div class="spec">
<p><tt>send_async_passive(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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>}, <a href="#type-agent">agent()</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="timeout_async-1">timeout_async/1</a></h3>
<div class="spec">
<p><tt>timeout_async(Context::<a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</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(Context::<a href="#type-agent">agent()</a>) -> {<a href="#type-trans_id">trans_id()</a>, <a href="#type-agent">agent()</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="trans_id_age-1">trans_id_age/1</a></h3>
<div class="spec">
<p><tt>trans_id_age(TransId::<a href="#type-trans_id">trans_id()</a>) -> non_neg_integer()</tt><br></p>
</div><p>
<h4><a name="Return_the_age_of_the_transaction_id.">Return the age of the transaction id.</a></h4>
The result is microseconds since the Unix epoch 1970-01-01 00:00:00.</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>