doc/SidekiqUniqueJobs/Redis/Entity.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: SidekiqUniqueJobs::Redis::Entity
— Documentation by YARD 0.9.26
</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
<link rel="stylesheet" href="../../css/common.css" type="text/css" />
<script type="text/javascript">
pathId = "SidekiqUniqueJobs::Redis::Entity";
relpath = '../../';
</script>
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="../../class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../../_index.html">Index (E)</a> »
<span class='title'><span class='object_link'><a href="../../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span> » <span class='title'><span class='object_link'><a href="../Redis.html" title="SidekiqUniqueJobs::Redis (module)">Redis</a></span></span>
»
<span class="title">Entity</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../../class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><h1>Class: SidekiqUniqueJobs::Redis::Entity
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">SidekiqUniqueJobs::Redis::Entity</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Includes:</dt>
<dd><span class='object_link'><a href="../JSON.html" title="SidekiqUniqueJobs::JSON (module)">JSON</a></span>, <span class='object_link'><a href="../Logging.html" title="SidekiqUniqueJobs::Logging (module)">Logging</a></span>, <span class='object_link'><a href="../Script/Caller.html" title="SidekiqUniqueJobs::Script::Caller (module)">Script::Caller</a></span>, <span class='object_link'><a href="../Timing.html" title="SidekiqUniqueJobs::Timing (module)">Timing</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/sidekiq_unique_jobs/redis/entity.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Class Entity functions as a base class for redis types</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Author:</p>
<ul class="author">
<li>
<div class='inline'><p>Mikael Henriksson <a href="mailto:mikael@mhenrixon.com">mikael@mhenrixon.com</a></p>
</div>
</li>
</ul>
</div><div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="Hash.html" title="SidekiqUniqueJobs::Redis::Hash (class)">Hash</a></span>, <span class='object_link'><a href="List.html" title="SidekiqUniqueJobs::Redis::List (class)">List</a></span>, <span class='object_link'><a href="Set.html" title="SidekiqUniqueJobs::Redis::Set (class)">Set</a></span>, <span class='object_link'><a href="SortedSet.html" title="SidekiqUniqueJobs::Redis::SortedSet (class)">SortedSet</a></span>, <span class='object_link'><a href="String.html" title="SidekiqUniqueJobs::Redis::String (class)">String</a></span></p>
</div>
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#key-instance_method" title="#key (instance method)">#<strong>key</strong> ⇒ Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute key.</p>
</div></span>
</li>
</ul>
<h2>
Instance Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#build_message-instance_method" title="#build_message (instance method)">#<strong>build_message</strong>(message_or_exception, item = nil) ⇒ String </a>
</span>
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="../Logging.html#build_message-instance_method" title="SidekiqUniqueJobs::Logging#build_message (method)">Logging</a></span>
</span>
<span class="summary_desc"><div class='inline'><p>Build a log message.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#count-instance_method" title="#count (instance method)">#<strong>count</strong> ⇒ Integer </a>
</span>
<span class="summary_desc"><div class='inline'><p>Returns the number of entries in this entity.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#exist%3F-instance_method" title="#exist? (instance method)">#<strong>exist?</strong> ⇒ true, false </a>
</span>
<span class="summary_desc"><div class='inline'><p>Checks if the key for this entity exists in redis.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#expires%3F-instance_method" title="#expires? (instance method)">#<strong>expires?</strong> ⇒ true, false </a>
</span>
<span class="summary_desc"><div class='inline'><p>Check if the entity has expiration.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(key) ⇒ Entity </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'><p>Initialize a new Entity.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#log_debug-instance_method" title="#log_debug (instance method)">#<strong>log_debug</strong>(message_or_exception = nil, item = nil) {|String, Exception| ... } ⇒ void </a>
</span>
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="../Logging.html#log_debug-instance_method" title="SidekiqUniqueJobs::Logging#log_debug (method)">Logging</a></span>
</span>
<span class="summary_desc"><div class='inline'><p>Logs a message at debug level.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#log_error-instance_method" title="#log_error (instance method)">#<strong>log_error</strong>(message_or_exception = nil, item = nil) {|String, Exception| ... } ⇒ void </a>
</span>
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="../Logging.html#log_error-instance_method" title="SidekiqUniqueJobs::Logging#log_error (method)">Logging</a></span>
</span>
<span class="summary_desc"><div class='inline'><p>Logs a message at error level.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#log_fatal-instance_method" title="#log_fatal (instance method)">#<strong>log_fatal</strong>(message_or_exception = nil, item = nil) {|String, Exception| ... } ⇒ void </a>
</span>
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="../Logging.html#log_fatal-instance_method" title="SidekiqUniqueJobs::Logging#log_fatal (method)">Logging</a></span>
</span>
<span class="summary_desc"><div class='inline'><p>Logs a message at fatal level.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#log_info-instance_method" title="#log_info (instance method)">#<strong>log_info</strong>(message_or_exception = nil, item = nil) {|String, Exception| ... } ⇒ void </a>
</span>
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="../Logging.html#log_info-instance_method" title="SidekiqUniqueJobs::Logging#log_info (method)">Logging</a></span>
</span>
<span class="summary_desc"><div class='inline'><p>Logs a message at info level.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#log_warn-instance_method" title="#log_warn (instance method)">#<strong>log_warn</strong>(message_or_exception = nil, item = nil) {|String, Exception| ... } ⇒ void </a>
</span>
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="../Logging.html#log_warn-instance_method" title="SidekiqUniqueJobs::Logging#log_warn (method)">Logging</a></span>
</span>
<span class="summary_desc"><div class='inline'><p>Logs a message at warn level.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#logger-instance_method" title="#logger (instance method)">#<strong>logger</strong> ⇒ Logger </a>
</span>
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="../Logging.html#logger-instance_method" title="SidekiqUniqueJobs::Logging#logger (method)">Logging</a></span>
</span>
<span class="summary_desc"><div class='inline'><p>A convenience method for using the configured gem logger.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#logging_context-instance_method" title="#logging_context (instance method)">#<strong>logging_context</strong> ⇒ Hash </a>
</span>
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="../Logging.html#logging_context-instance_method" title="SidekiqUniqueJobs::Logging#logging_context (method)">Logging</a></span>
</span>
<span class="summary_desc"><div class='inline'><p>Setup some variables to add to each log line.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#pttl-instance_method" title="#pttl (instance method)">#<strong>pttl</strong> ⇒ Integer </a>
</span>
<span class="summary_desc"><div class='inline'><p>The number of microseconds until the key expires.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#ttl-instance_method" title="#ttl (instance method)">#<strong>ttl</strong> ⇒ Integer </a>
</span>
<span class="summary_desc"><div class='inline'><p>The number of seconds until the key expires.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#with_configured_loggers_context-instance_method" title="#with_configured_loggers_context (instance method)">#<strong>with_configured_loggers_context</strong> { ... } ⇒ void </a>
</span>
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="../Logging.html#with_configured_loggers_context-instance_method" title="SidekiqUniqueJobs::Logging#with_configured_loggers_context (method)">Logging</a></span>
</span>
<span class="summary_desc"><div class='inline'><p>Attempt to setup context aware logging for the given logger.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#with_logging_context-instance_method" title="#with_logging_context (instance method)">#<strong>with_logging_context</strong> ⇒ void </a>
</span>
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="../Logging.html#with_logging_context-instance_method" title="SidekiqUniqueJobs::Logging#with_logging_context (method)">Logging</a></span>
</span>
<span class="summary_desc"><div class='inline'><p>Wraps the middleware logic with context aware logging.</p>
</div></span>
</li>
</ul>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
#<strong>initialize</strong>(key) ⇒ <tt><span class='object_link'><a href="" title="SidekiqUniqueJobs::Redis::Entity (class)">Entity</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Initialize a new Entity</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>key</span>
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="SidekiqUniqueJobs::Redis::String (class)">String</a></span></tt>)</span>
—
<div class='inline'><p>the redis key for this entity</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
37
38
39</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis/entity.rb', line 37</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
<span class='ivar'>@key</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id=""></span>
<div class="method_details first">
<h3 class="signature first" id="key-instance_method">
#<strong>key</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute key.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
30
31
32</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis/entity.rb', line 30</span>
<span class='kw'>def</span> <span class='id identifier rubyid_key'>key</span>
<span class='ivar'>@key</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="build_message-instance_method">
#<strong>build_message</strong>(message_or_exception, item = nil) ⇒ <tt>String</tt>
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="../Logging.html#build_message-instance_method" title="SidekiqUniqueJobs::Logging#build_message (method)">Logging</a></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p>Build a log message</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>message_or_exception</span>
<span class='type'>(<tt>String</tt>, <tt>Exception</tt>)</span>
—
<div class='inline'><p>an entry to log</p>
</div>
</li>
<li>
<span class='name'>item</span>
<span class='type'>(<tt><span class='object_link'><a href="../../Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
—
<div class='inline'><p>the sidekiq job hash</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
—
<div class='inline'><p>a complete log entry</p>
</div>
</li>
</ul>
</div>
</div>
<div class="method_details ">
<h3 class="signature " id="count-instance_method">
#<strong>count</strong> ⇒ <tt>Integer</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the number of entries in this entity</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Integer</tt>)</span>
—
<div class='inline'><p>0</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
101
102
103</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis/entity.rb', line 101</span>
<span class='kw'>def</span> <span class='id identifier rubyid_count'>count</span>
<span class='int'>0</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="exist?-instance_method">
#<strong>exist?</strong> ⇒ <tt>true</tt>, <tt>false</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks if the key for this entity exists in redis</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>true</tt>)</span>
—
<div class='inline'><p>when exists</p>
</div>
</li>
<li>
<span class='type'>(<tt>false</tt>)</span>
—
<div class='inline'><p>when not exists</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis/entity.rb', line 48</span>
<span class='kw'>def</span> <span class='id identifier rubyid_exist?'>exist?</span>
<span class='id identifier rubyid_redis'>redis</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_conn'>conn</span><span class='op'>|</span>
<span class='comment'># TODO: Remove the if statement in the future
</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span>
<span class='kw'>if</span> <span class='id identifier rubyid_conn'>conn</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:exists?</span><span class='rparen'>)</span>
<span class='id identifier rubyid_conn'>conn</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_conn'>conn</span><span class='period'>.</span><span class='id identifier rubyid_exists'>exists</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>return</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>if</span> <span class='id identifier rubyid_boolean?'>boolean?</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
<span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='period'>.</span><span class='id identifier rubyid_positive?'>positive?</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="expires?-instance_method">
#<strong>expires?</strong> ⇒ <tt>true</tt>, <tt>false</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Check if the entity has expiration</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>true</tt>)</span>
—
<div class='inline'><p>when entity is set to exire</p>
</div>
</li>
<li>
<span class='type'>(<tt>false</tt>)</span>
—
<div class='inline'><p>when entity isn't expiring</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
91
92
93</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis/entity.rb', line 91</span>
<span class='kw'>def</span> <span class='id identifier rubyid_expires?'>expires?</span>
<span class='id identifier rubyid_pttl'>pttl</span><span class='period'>.</span><span class='id identifier rubyid_positive?'>positive?</span> <span class='op'>||</span> <span class='id identifier rubyid_ttl'>ttl</span><span class='period'>.</span><span class='id identifier rubyid_positive?'>positive?</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="log_debug-instance_method">
#<strong>log_debug</strong>(message_or_exception = nil, item = nil) {|String, Exception| ... } ⇒ <tt>void</tt>
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="../Logging.html#log_debug-instance_method" title="SidekiqUniqueJobs::Logging#log_debug (method)">Logging</a></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p><p>Logs a message at debug level</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>message_or_exception</span>
<span class='type'>(<tt>String</tt>, <tt>Exception</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
—
<div class='inline'><p>the message or exception to log</p>
</div>
</li>
</ul>
<p class="tag_title">Yields:</p>
<ul class="yield">
<li>
<span class='type'>(<tt>String</tt>, <tt>Exception</tt>)</span>
—
<div class='inline'><p>the message or exception to use for log message</p>
</div>
</li>
</ul>
</div>
</div>
<div class="method_details ">
<h3 class="signature " id="log_error-instance_method">
#<strong>log_error</strong>(message_or_exception = nil, item = nil) {|String, Exception| ... } ⇒ <tt>void</tt>
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="../Logging.html#log_error-instance_method" title="SidekiqUniqueJobs::Logging#log_error (method)">Logging</a></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p><p>Logs a message at error level</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>message_or_exception</span>
<span class='type'>(<tt>String</tt>, <tt>Exception</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
—
<div class='inline'><p>the message or exception to log</p>
</div>
</li>
</ul>
<p class="tag_title">Yields:</p>
<ul class="yield">
<li>
<span class='type'>(<tt>String</tt>, <tt>Exception</tt>)</span>
—
<div class='inline'><p>the message or exception to use for log message</p>
</div>
</li>
</ul>
</div>
</div>
<div class="method_details ">
<h3 class="signature " id="log_fatal-instance_method">
#<strong>log_fatal</strong>(message_or_exception = nil, item = nil) {|String, Exception| ... } ⇒ <tt>void</tt>
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="../Logging.html#log_fatal-instance_method" title="SidekiqUniqueJobs::Logging#log_fatal (method)">Logging</a></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p><p>Logs a message at fatal level</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>message_or_exception</span>
<span class='type'>(<tt>String</tt>, <tt>Exception</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
—
<div class='inline'><p>the message or exception to log</p>
</div>
</li>
</ul>
<p class="tag_title">Yields:</p>
<ul class="yield">
<li>
<span class='type'>(<tt>String</tt>, <tt>Exception</tt>)</span>
—
<div class='inline'><p>the message or exception to use for log message</p>
</div>
</li>
</ul>
</div>
</div>
<div class="method_details ">
<h3 class="signature " id="log_info-instance_method">
#<strong>log_info</strong>(message_or_exception = nil, item = nil) {|String, Exception| ... } ⇒ <tt>void</tt>
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="../Logging.html#log_info-instance_method" title="SidekiqUniqueJobs::Logging#log_info (method)">Logging</a></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p><p>Logs a message at info level</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>message_or_exception</span>
<span class='type'>(<tt>String</tt>, <tt>Exception</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
—
<div class='inline'><p>the message or exception to log</p>
</div>
</li>
</ul>
<p class="tag_title">Yields:</p>
<ul class="yield">
<li>
<span class='type'>(<tt>String</tt>, <tt>Exception</tt>)</span>
—
<div class='inline'><p>the message or exception to use for log message</p>
</div>
</li>
</ul>
</div>
</div>
<div class="method_details ">
<h3 class="signature " id="log_warn-instance_method">
#<strong>log_warn</strong>(message_or_exception = nil, item = nil) {|String, Exception| ... } ⇒ <tt>void</tt>
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="../Logging.html#log_warn-instance_method" title="SidekiqUniqueJobs::Logging#log_warn (method)">Logging</a></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p><p>Logs a message at warn level</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>message_or_exception</span>
<span class='type'>(<tt>String</tt>, <tt>Exception</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
—
<div class='inline'><p>the message or exception to log</p>
</div>
</li>
</ul>
<p class="tag_title">Yields:</p>
<ul class="yield">
<li>
<span class='type'>(<tt>String</tt>, <tt>Exception</tt>)</span>
—
<div class='inline'><p>the message or exception to use for log message</p>
</div>
</li>
</ul>
</div>
</div>
<div class="method_details ">
<h3 class="signature " id="logger-instance_method">
#<strong>logger</strong> ⇒ <tt>Logger</tt>
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="../Logging.html#logger-instance_method" title="SidekiqUniqueJobs::Logging#logger (method)">Logging</a></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p>A convenience method for using the configured gem logger</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Logger</tt>)</span>
</li>
</ul>
<p class="tag_title">See Also:</p>
<ul class="see">
<li>SidekiqUniqueJobs#.logger</li>
</ul>
</div>
</div>
<div class="method_details ">
<h3 class="signature " id="logging_context-instance_method">
#<strong>logging_context</strong> ⇒ <tt><span class='object_link'><a href="../../Hash.html" title="Hash (class)">Hash</a></span></tt>
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="../Logging.html#logging_context-instance_method" title="SidekiqUniqueJobs::Logging#logging_context (method)">Logging</a></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p>Setup some variables to add to each log line</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../../Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
—
<div class='inline'><p>the context to use for each log line</p>
</div>
</li>
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt>NotImplementedError</tt>)</span>
</li>
</ul>
</div>
</div>
<div class="method_details ">
<h3 class="signature " id="pttl-instance_method">
#<strong>pttl</strong> ⇒ <tt>Integer</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The number of microseconds until the key expires</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Integer</tt>)</span>
—
<div class='inline'><p>expiration in milliseconds</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
70
71
72</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis/entity.rb', line 70</span>
<span class='kw'>def</span> <span class='id identifier rubyid_pttl'>pttl</span>
<span class='id identifier rubyid_redis'>redis</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_conn'>conn</span><span class='op'>|</span> <span class='id identifier rubyid_conn'>conn</span><span class='period'>.</span><span class='id identifier rubyid_pttl'>pttl</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="ttl-instance_method">
#<strong>ttl</strong> ⇒ <tt>Integer</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The number of seconds until the key expires</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Integer</tt>)</span>
—
<div class='inline'><p>expiration in seconds</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
80
81
82</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis/entity.rb', line 80</span>
<span class='kw'>def</span> <span class='id identifier rubyid_ttl'>ttl</span>
<span class='id identifier rubyid_redis'>redis</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_conn'>conn</span><span class='op'>|</span> <span class='id identifier rubyid_conn'>conn</span><span class='period'>.</span><span class='id identifier rubyid_ttl'>ttl</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="with_configured_loggers_context-instance_method">
#<strong>with_configured_loggers_context</strong> { ... } ⇒ <tt>void</tt>
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="../Logging.html#with_configured_loggers_context-instance_method" title="SidekiqUniqueJobs::Logging#with_configured_loggers_context (method)">Logging</a></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p><p>Attempt to setup context aware logging for the given logger</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Yields:</p>
<ul class="yield">
<li>
<span class='type'></span>
</li>
</ul>
</div>
</div>
<div class="method_details ">
<h3 class="signature " id="with_logging_context-instance_method">
#<strong>with_logging_context</strong> ⇒ <tt>void</tt>
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="../Logging.html#with_logging_context-instance_method" title="SidekiqUniqueJobs::Logging#with_logging_context (method)">Logging</a></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p><p>Wraps the middleware logic with context aware logging</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Yield Returns:</p>
<ul class="yieldreturn">
<li>
<span class='type'>(<tt>void</tt>)</span>
—
<div class='inline'><p>yield to the middleware instance</p>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Sep 27 15:29:08 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-3.0.2).
</div>
</div>
</body>
</html>