Current section

Files

Jump to
cloudi_core doc cloudi_trans_id.html
Raw

doc/cloudi_trans_id.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_trans_id</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_trans_id</h1>
<ul class="index"><li><a href="#description">Description</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>
<h3><a name="CloudI_Transaction_ID_Usage">CloudI Transaction ID Usage</a></h3>
Convenience functions for using the v1 UUID used as the
transaction id ("TransId" or "trans_id") that follows a CloudI
service request for the lifetime (defined by the service request timeout)
of the request and its response result.
<p>Copyright © 2015-2020 Michael Truog</p>
<p><b>Version:</b> 2.0.1 May 26 2021 19:42:48
------------------------------------------------------------------------</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_Transaction_ID_Usage">CloudI Transaction ID Usage</a></h3>
Convenience functions for using the v1 UUID used as the
transaction id ("TransId" or "trans_id") that follows a CloudI
service request for the lifetime (defined by the service request timeout)
of the request and its response result.
<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="#datetime-1">datetime/1</a></td><td>
<h4><a name="Provide_an_ISO8601_datetime_in_UTC_based_on_the_time_stored_in_the_transaction_id.">Provide an ISO8601 datetime in UTC based on the time stored in the transaction id.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#datetime-2">datetime/2</a></td><td>
<h4><a name="Provide_an_ISO8601_datetime_in_UTC_based_on_the_time_stored_in_the_transaction_id_with_an_offset_in_microseconds.">Provide an ISO8601 datetime in UTC based on the time stored in the transaction id with an offset in microseconds.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#from_string-1">from_string/1</a></td><td>
<h4><a name="Return_a_transaction_id_as_a_binary_UUID_(16_bytes).">Return a transaction id as a binary UUID (16 bytes).</a></h4>.</td></tr>
<tr><td valign="top"><a href="#increment-1">increment/1</a></td><td>
<h4><a name="Increment_the_transaction_id_while_preserving_uniqueness.">Increment the transaction id while preserving uniqueness.</a></h4>
Increment the v1 UUID's clock_seq (14bit) integer for 16384 possible
v1 UUID values based on a single transaction id.</td></tr>
<tr><td valign="top"><a href="#microseconds-0">microseconds/0</a></td><td>
<h4><a name="Microseconds_since_the_UNIX_epoch.">Microseconds since the UNIX epoch.</a></h4>
The integer value returned uses the same time source used for creating
TransId v1 UUIDs, though the return values are not strictly
monotonically increasing on Erlang &gt;= 18.0 if the OS time is changed
(TransId v1 UUID time values are strictly monotonically increasing
when comparing TransId values created by the same service Erlang process).</td></tr>
<tr><td valign="top"><a href="#microseconds-1">microseconds/1</a></td><td>
<h4><a name="Microseconds_since_the_UNIX_epoch.">Microseconds since the UNIX epoch.</a></h4>
The integer value returned is always increasing for each service process
that created the TransId (with the service process uniquely represented
in the node_id section of the v1 UUID).</td></tr>
<tr><td valign="top"><a href="#to_string-1">to_string/1</a></td><td>
<h4><a name="Return_the_transaction_id_in_a_standard_string_format.">Return the transaction id in a standard string format.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#to_string-2">to_string/2</a></td><td>
<h4><a name="Return_the_transaction_id_in_a_string_format.">Return the transaction id in a string format.</a></h4>.</td></tr>
</table>
<h2><a name="functions">Function Details</a></h2>
<h3 class="function"><a name="datetime-1">datetime/1</a></h3>
<div class="spec">
<p><tt>datetime(TransId::<a href="deps/uuid/doc/uuid.html#type-uuid">uuid:uuid()</a>) -&gt; <a href="cloudi_timestamp.html#type-iso8601">cloudi_timestamp:iso8601()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Provide_an_ISO8601_datetime_in_UTC_based_on_the_time_stored_in_the_transaction_id.">Provide an ISO8601 datetime in UTC based on the time stored in the transaction id.</a></h4>
</p>
<h3 class="function"><a name="datetime-2">datetime/2</a></h3>
<div class="spec">
<p><tt>datetime(TransId::<a href="deps/uuid/doc/uuid.html#type-uuid">uuid:uuid()</a>, MicroSecondsOffset::integer()) -&gt; <a href="cloudi_timestamp.html#type-iso8601">cloudi_timestamp:iso8601()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Provide_an_ISO8601_datetime_in_UTC_based_on_the_time_stored_in_the_transaction_id_with_an_offset_in_microseconds.">Provide an ISO8601 datetime in UTC based on the time stored in the transaction id with an offset in microseconds.</a></h4>
</p>
<h3 class="function"><a name="from_string-1">from_string/1</a></h3>
<div class="spec">
<p><tt>from_string(String::<a href="deps/uuid/doc/uuid.html#type-uuid_string">uuid:uuid_string()</a>) -&gt; <a href="deps/uuid/doc/uuid.html#type-uuid">uuid:uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Return_a_transaction_id_as_a_binary_UUID_(16_bytes).">Return a transaction id as a binary UUID (16 bytes).</a></h4>
</p>
<h3 class="function"><a name="increment-1">increment/1</a></h3>
<div class="spec">
<p><tt>increment(TransId::<a href="deps/uuid/doc/uuid.html#type-uuid">uuid:uuid()</a>) -&gt; <a href="deps/uuid/doc/uuid.html#type-uuid">uuid:uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Increment_the_transaction_id_while_preserving_uniqueness.">Increment the transaction id while preserving uniqueness.</a></h4>
Increment the v1 UUID's clock_seq (14bit) integer for 16384 possible
v1 UUID values based on a single transaction id.</p>
<h3 class="function"><a name="microseconds-0">microseconds/0</a></h3>
<div class="spec">
<p><tt>microseconds() -&gt; non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Microseconds_since_the_UNIX_epoch.">Microseconds since the UNIX epoch.</a></h4>
The integer value returned uses the same time source used for creating
TransId v1 UUIDs, though the return values are not strictly
monotonically increasing on Erlang &gt;= 18.0 if the OS time is changed
(TransId v1 UUID time values are strictly monotonically increasing
when comparing TransId values created by the same service Erlang process).
(The UNIX epoch is 1970-01-01T00:00:00)</p>
<h3 class="function"><a name="microseconds-1">microseconds/1</a></h3>
<div class="spec">
<p><tt>microseconds(TransId::<a href="deps/uuid/doc/uuid.html#type-uuid">uuid:uuid()</a>) -&gt; non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Microseconds_since_the_UNIX_epoch.">Microseconds since the UNIX epoch.</a></h4>
The integer value returned is always increasing for each service process
that created the TransId (with the service process uniquely represented
in the node_id section of the v1 UUID).
(The UNIX epoch is 1970-01-01T00:00:00)</p>
<h3 class="function"><a name="to_string-1">to_string/1</a></h3>
<div class="spec">
<p><tt>to_string(TransId::<a href="deps/uuid/doc/uuid.html#type-uuid">uuid:uuid()</a>) -&gt; <a href="deps/uuid/doc/uuid.html#type-uuid_string_list">uuid:uuid_string_list()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Return_the_transaction_id_in_a_standard_string_format.">Return the transaction id in a standard string format.</a></h4>
</p>
<h3 class="function"><a name="to_string-2">to_string/2</a></h3>
<div class="spec">
<p><tt>to_string(TransId::<a href="deps/uuid/doc/uuid.html#type-uuid">uuid:uuid()</a>, Format::standard | nodash | list_standard | list_nodash | binary_standard | binary_nodash) -&gt; <a href="deps/uuid/doc/uuid.html#type-uuid_string">uuid:uuid_string()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Return_the_transaction_id_in_a_string_format.">Return the transaction id in a string format.</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</i></p>
</body>
</html>