mhenrixon/sidekiq-unique-jobs

View on GitHub
doc/SidekiqUniqueJobs/LockTTL.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: SidekiqUniqueJobs::LockTTL
Unexpected trailing spaces found.
&mdash; Documentation by YARD 0.9.26
Unexpected trailing spaces found.
</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::LockTTL";
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">
Unexpected trailing spaces found.
<a href="../_index.html">Index (L)</a> &raquo;
<span class='title'><span class='object_link'><a href="../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span>
Expected an indentation at 6 instead of at 5.
Unexpected trailing spaces found.
&raquo;
<span class="title">LockTTL</span>
Unexpected trailing spaces found.
</div>
 
<div id="search">
Unexpected trailing spaces found.
<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>
Unexpected trailing spaces found.
</div>
<div class="clear"></div>
</div>
 
<div id="content"><h1>Class: SidekiqUniqueJobs::LockTTL
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
</h1>
<div class="box_info">
Unexpected trailing spaces found.
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName">Object</span>
Unexpected trailing spaces found.
<ul class="fullTree">
<li>Object</li>
Unexpected trailing spaces found.
<li class="next">SidekiqUniqueJobs::LockTTL</li>
Unexpected trailing spaces found.
</ul>
<a href="#" class="inheritanceTree">show all</a>
Unexpected trailing spaces found.
</dd>
</dl>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<dl>
<dt>Includes:</dt>
<dd><span class='object_link'><a href="SidekiqWorkerMethods.html" title="SidekiqUniqueJobs::SidekiqWorkerMethods (module)">SidekiqWorkerMethods</a></span></dd>
</dl>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<dl>
<dt>Defined in:</dt>
<dd>lib/sidekiq_unique_jobs/lock_ttl.rb</dd>
</dl>
Unexpected trailing spaces found.
</div>
 
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Calculates timeout and expiration</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
<p class="tag_title">Author:</p>
<ul class="author">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<div class='inline'><p>Mikael Henriksson <a href="mailto:mikael@mhenrixon.com">mikael@mhenrixon.com</a></p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
</div>
 
 
 
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
<ul class="summary">
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#item-instance_method" title="#item (instance method)">#<strong>item</strong> &#x21d2; Object </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class="note title readonly">readonly</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute item.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
</ul>
 
 
 
 
Unexpected trailing spaces found.
<h2>
Class Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
 
<ul class="summary">
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#calculate-class_method" title="calculate (class method)">.<strong>calculate</strong>(item) &#x21d2; Integer </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>Computes lock ttl from job arguments, sidekiq_options.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
</ul>
Unexpected trailing spaces found.
<h2>
Instance Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
 
<ul class="summary">
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#after_unlock_hook-instance_method" title="#after_unlock_hook (instance method)">#<strong>after_unlock_hook</strong> &#x21d2; Proc </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="SidekiqWorkerMethods.html#after_unlock_hook-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#after_unlock_hook (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>The hook to call after a successful unlock.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#calculate-instance_method" title="#calculate (instance method)">#<strong>calculate</strong> &#x21d2; Integer </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>Computes lock ttl from job arguments, sidekiq_options.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#default_worker_options-instance_method" title="#default_worker_options (instance method)">#<strong>default_worker_options</strong> &#x21d2; Hash&lt;Symbol, Object&gt; </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="SidekiqWorkerMethods.html#default_worker_options-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#default_worker_options (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>Returns the default worker options from Sidekiq.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(item) &#x21d2; LockTTL </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class="note title constructor">constructor</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>A new instance of LockTTL.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#scheduled_at-instance_method" title="#scheduled_at (instance method)">#<strong>scheduled_at</strong> &#x21d2; Float </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>The time a job is scheduled.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#sidekiq_worker_class%3F-instance_method" title="#sidekiq_worker_class? (instance method)">#<strong>sidekiq_worker_class?</strong> &#x21d2; true, false </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="SidekiqWorkerMethods.html#sidekiq_worker_class%3F-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#sidekiq_worker_class? (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>Tests that the.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#time_until_scheduled-instance_method" title="#time_until_scheduled (instance method)">#<strong>time_until_scheduled</strong> &#x21d2; Integer </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>Calculates the time until the job is scheduled starting from now.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#worker_class-instance_method" title="#worker_class (instance method)">#<strong>worker_class</strong> &#x21d2; Sidekiq::Worker </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="SidekiqWorkerMethods.html#worker_class-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#worker_class (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>The Sidekiq::Worker implementation.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#worker_class_constantize-instance_method" title="#worker_class_constantize (instance method)">#<strong>worker_class_constantize</strong>(klazz = @worker_class) &#x21d2; Sidekiq::Worker </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="SidekiqWorkerMethods.html#worker_class_constantize-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#worker_class_constantize (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>Attempt to constantize a string worker_class argument, always failing back to the original argument when the constant can&#39;t be found.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#worker_method_defined%3F-instance_method" title="#worker_method_defined? (instance method)">#<strong>worker_method_defined?</strong>(method_sym) &#x21d2; true, false </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="SidekiqWorkerMethods.html#worker_method_defined%3F-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#worker_method_defined? (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>Avoids duplicating worker_class.respond_to? in multiple places.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
<li class="public ">
<span class="summary_signature">
Unexpected trailing spaces found.
<a href="#worker_options-instance_method" title="#worker_options (instance method)">#<strong>worker_options</strong> &#x21d2; Hash </a>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="SidekiqWorkerMethods.html#worker_options-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#worker_options (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="summary_desc"><div class='inline'><p>Wraps #get_sidekiq_options to always work with a hash.</p>
</div></span>
Unexpected trailing spaces found.
</li>
 
Unexpected trailing spaces found.
</ul>
Unexpected trailing spaces found.
 
 
Unexpected trailing spaces found.
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
Unexpected trailing spaces found.
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
Unexpected trailing spaces found.
Unexpected trailing spaces found.
#<strong>initialize</strong>(item) &#x21d2; <tt><span class='object_link'><a href="" title="SidekiqUniqueJobs::LockTTL (class)">LockTTL</a></span></tt>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of LockTTL.</p>
 
 
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
<span class='name'>item</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
&mdash;
<div class='inline'><p>the Sidekiq job hash</p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<p class="tag_title">Options Hash (<tt>item</tt>):</p>
<ul class="option">
Unexpected trailing spaces found.
<li>
<span class="name">:lock_ttl</span>
<span class="type">(<tt>Integer</tt>, <tt>nil</tt>)</span>
<span class="default">
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
&mdash; <div class='inline'><p>the configured lock expiration</p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
<li>
<span class="name">:lock_timeout</span>
<span class="type">(<tt>Integer</tt>, <tt>nil</tt>)</span>
<span class="default">
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
&mdash; <div class='inline'><p>the configured lock timeout</p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
<li>
<span class="name">:class</span>
<span class="type">(<tt>String</tt>)</span>
<span class="default">
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
&mdash; <div class='inline'><p>the class of the sidekiq worker</p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
<li>
<span class="name">:at</span>
<span class="type">(<tt>Float</tt>)</span>
<span class="default">
Unexpected trailing spaces found.
</span>
Unexpected trailing spaces found.
&mdash; <div class='inline'><p>the unix time the job is scheduled at</p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
Unexpected trailing spaces found.
 
 
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
 
 
35
36
37
38</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/lock_ttl.rb', line 35</span>
 
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span>
<span class='ivar'>@item</span> <span class='op'>=</span> <span class='id identifier rubyid_item'>item</span>
<span class='ivar'>@worker_class</span> <span class='op'>=</span> <span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="../SidekiqUniqueJobs.html#CLASS-constant" title="SidekiqUniqueJobs::CLASS (constant)">CLASS</a></span></span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
Unexpected trailing spaces found.
</div>
 
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span id=""></span>
<div class="method_details first">
<h3 class="signature first" id="item-instance_method">
Unexpected trailing spaces found.
#<strong>item</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute item.</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
 
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
 
 
28
29
30</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/lock_ttl.rb', line 28</span>
 
<span class='kw'>def</span> <span class='id identifier rubyid_item'>item</span>
<span class='ivar'>@item</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
Unexpected trailing spaces found.
</div>
 
 
<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
 
Unexpected trailing spaces found.
<div class="method_details first">
<h3 class="signature first" id="calculate-class_method">
Unexpected trailing spaces found.
Unexpected trailing spaces found.
.<strong>calculate</strong>(item) &#x21d2; <tt>Integer</tt>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
Unexpected trailing spaces found.
<div class="note notetag">
<strong>Note:</strong>
<div class='inline'><p>this method takes into consideration the time
until a job is scheduled</p>
</div>
</div>
 
<p>Computes lock ttl from job arguments, sidekiq_options.
Falls back to Config#lock_ttl</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
<p class="tag_title">Returns:</p>
<ul class="return">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt>Integer</tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
&mdash;
<div class='inline'><p>the number of seconds to live</p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
 
 
22
23
24</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/lock_ttl.rb', line 22</span>
 
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_calculate'>calculate</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span>
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_calculate'>calculate</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
Unexpected trailing spaces found.
</div>
 
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
 
Unexpected trailing spaces found.
<div class="method_details first">
<h3 class="signature first" id="after_unlock_hook-instance_method">
Unexpected trailing spaces found.
Unexpected trailing spaces found.
#<strong>after_unlock_hook</strong> &#x21d2; <tt>Proc</tt>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="SidekiqWorkerMethods.html#after_unlock_hook-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#after_unlock_hook (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
<p>The hook to call after a successful unlock</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
<p class="tag_title">Returns:</p>
<ul class="return">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt>Proc</tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
</div>
</div>
Unexpected trailing spaces found.
<div class="method_details ">
<h3 class="signature " id="calculate-instance_method">
Unexpected trailing spaces found.
Unexpected trailing spaces found.
#<strong>calculate</strong> &#x21d2; <tt>Integer</tt>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
Unexpected trailing spaces found.
<div class="note notetag">
<strong>Note:</strong>
<div class='inline'><p>this method takes into consideration the time
until a job is scheduled</p>
</div>
</div>
 
<p>Computes lock ttl from job arguments, sidekiq_options.
Falls back to Config#lock_ttl</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
<p class="tag_title">Returns:</p>
<ul class="return">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt>Integer</tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
&mdash;
<div class='inline'><p>the number of seconds to live</p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
 
 
68
69
70
71
72
73
74
75</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/lock_ttl.rb', line 68</span>
 
<span class='kw'>def</span> <span class='id identifier rubyid_calculate'>calculate</span>
<span class='id identifier rubyid_ttl'>ttl</span> <span class='op'>=</span> <span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="../SidekiqUniqueJobs.html#LOCK_TTL-constant" title="SidekiqUniqueJobs::LOCK_TTL (constant)">LOCK_TTL</a></span></span><span class='rbracket'>]</span>
<span class='id identifier rubyid_ttl'>ttl</span> <span class='op'>||=</span> <span class='id identifier rubyid_worker_options'>worker_options</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="../SidekiqUniqueJobs.html#LOCK_TTL-constant" title="SidekiqUniqueJobs::LOCK_TTL (constant)">LOCK_TTL</a></span></span><span class='rbracket'>]</span>
TODO found
<span class='id identifier rubyid_ttl'>ttl</span> <span class='op'>||=</span> <span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="../SidekiqUniqueJobs.html#LOCK_EXPIRATION-constant" title="SidekiqUniqueJobs::LOCK_EXPIRATION (constant)">LOCK_EXPIRATION</a></span></span><span class='rbracket'>]</span> <span class='comment'># TODO: Deprecate at some point
TODO found
</span> <span class='id identifier rubyid_ttl'>ttl</span> <span class='op'>||=</span> <span class='id identifier rubyid_worker_options'>worker_options</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="../SidekiqUniqueJobs.html#LOCK_EXPIRATION-constant" title="SidekiqUniqueJobs::LOCK_EXPIRATION (constant)">LOCK_EXPIRATION</a></span></span><span class='rbracket'>]</span> <span class='comment'># TODO: Deprecate at some point
</span> <span class='id identifier rubyid_ttl'>ttl</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'><span class='object_link'><a href="../SidekiqUniqueJobs.html#config-class_method" title="SidekiqUniqueJobs.config (method)">config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_lock_ttl'>lock_ttl</span>
<span class='id identifier rubyid_ttl'>ttl</span> <span class='op'>&amp;&amp;</span> <span class='lparen'>(</span><span class='id identifier rubyid_ttl'>ttl</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>+</span> <span class='id identifier rubyid_time_until_scheduled'>time_until_scheduled</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
Unexpected trailing spaces found.
<div class="method_details ">
<h3 class="signature " id="default_worker_options-instance_method">
Unexpected trailing spaces found.
Unexpected trailing spaces found.
#<strong>default_worker_options</strong> &#x21d2; <tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span>&lt;Symbol, Object&gt;</tt>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="SidekiqWorkerMethods.html#default_worker_options-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#default_worker_options (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
<p>Returns the default worker options from Sidekiq</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
<p class="tag_title">Returns:</p>
<ul class="return">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span>&lt;Symbol, Object&gt;</tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
</div>
</div>
Unexpected trailing spaces found.
<div class="method_details ">
<h3 class="signature " id="scheduled_at-instance_method">
Unexpected trailing spaces found.
Unexpected trailing spaces found.
#<strong>scheduled_at</strong> &#x21d2; <tt>Float</tt>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
<p>The time a job is scheduled</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
<p class="tag_title">Returns:</p>
<ul class="return">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt>Float</tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
&mdash;
<div class='inline'><p>the exact unix time the job is scheduled at</p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
 
 
54
55
56</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/lock_ttl.rb', line 54</span>
 
<span class='kw'>def</span> <span class='id identifier rubyid_scheduled_at'>scheduled_at</span>
<span class='ivar'>@scheduled_at</span> <span class='op'>||=</span> <span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="../SidekiqUniqueJobs.html#AT-constant" title="SidekiqUniqueJobs::AT (constant)">AT</a></span></span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
Unexpected trailing spaces found.
<div class="method_details ">
<h3 class="signature " id="sidekiq_worker_class?-instance_method">
Unexpected trailing spaces found.
Unexpected trailing spaces found.
#<strong>sidekiq_worker_class?</strong> &#x21d2; <tt>true</tt>, <tt>false</tt>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="SidekiqWorkerMethods.html#sidekiq_worker_class%3F-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#sidekiq_worker_class? (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
<p>Tests that the</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
<p class="tag_title">Returns:</p>
<ul class="return">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt>true</tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
&mdash;
<div class='inline'><p>if worker_class responds to get_sidekiq_options</p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt>false</tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
&mdash;
<div class='inline'><p>if worker_class does not respond to get_sidekiq_options</p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
</div>
</div>
Unexpected trailing spaces found.
<div class="method_details ">
<h3 class="signature " id="time_until_scheduled-instance_method">
Unexpected trailing spaces found.
Unexpected trailing spaces found.
#<strong>time_until_scheduled</strong> &#x21d2; <tt>Integer</tt>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
<p>Calculates the time until the job is scheduled starting from now</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
<p class="tag_title">Returns:</p>
<ul class="return">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt>Integer</tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
&mdash;
<div class='inline'><p>the number of seconds until job is scheduled</p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
 
 
46
47
48
49
50</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/lock_ttl.rb', line 46</span>
 
<span class='kw'>def</span> <span class='id identifier rubyid_time_until_scheduled'>time_until_scheduled</span>
<span class='kw'>return</span> <span class='int'>0</span> <span class='kw'>unless</span> <span class='id identifier rubyid_scheduled_at'>scheduled_at</span>
 
<span class='id identifier rubyid_scheduled_at'>scheduled_at</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>-</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
Unexpected trailing spaces found.
<div class="method_details ">
<h3 class="signature " id="worker_class-instance_method">
Unexpected trailing spaces found.
Unexpected trailing spaces found.
#<strong>worker_class</strong> &#x21d2; <tt><span class='object_link'><a href="../Sidekiq/Worker.html" title="Sidekiq::Worker (module)">Sidekiq::Worker</a></span></tt>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="SidekiqWorkerMethods.html#worker_class-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#worker_class (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
<p>The Sidekiq::Worker implementation</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
<p class="tag_title">Returns:</p>
<ul class="return">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt><span class='object_link'><a href="../Sidekiq/Worker.html" title="Sidekiq::Worker (module)">Sidekiq::Worker</a></span></tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
</div>
</div>
Unexpected trailing spaces found.
<div class="method_details ">
<h3 class="signature " id="worker_class_constantize-instance_method">
Unexpected trailing spaces found.
Unexpected trailing spaces found.
#<strong>worker_class_constantize</strong>(klazz = @worker_class) &#x21d2; <tt><span class='object_link'><a href="../Sidekiq/Worker.html" title="Sidekiq::Worker (module)">Sidekiq::Worker</a></span></tt>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="SidekiqWorkerMethods.html#worker_class_constantize-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#worker_class_constantize (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
<p>Attempt to constantize a string worker_class argument, always
failing back to the original argument when the constant can&#39;t be found</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
<p class="tag_title">Returns:</p>
<ul class="return">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt><span class='object_link'><a href="../Sidekiq/Worker.html" title="Sidekiq::Worker (module)">Sidekiq::Worker</a></span></tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
</div>
</div>
Unexpected trailing spaces found.
<div class="method_details ">
<h3 class="signature " id="worker_method_defined?-instance_method">
Unexpected trailing spaces found.
Unexpected trailing spaces found.
#<strong>worker_method_defined?</strong>(method_sym) &#x21d2; <tt>true</tt>, <tt>false</tt>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="SidekiqWorkerMethods.html#worker_method_defined%3F-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#worker_method_defined? (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
<p>Avoids duplicating worker_class.respond_to? in multiple places</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
<p class="tag_title">Returns:</p>
<ul class="return">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
</div>
</div>
Unexpected trailing spaces found.
<div class="method_details ">
<h3 class="signature " id="worker_options-instance_method">
Unexpected trailing spaces found.
Unexpected trailing spaces found.
#<strong>worker_options</strong> &#x21d2; <tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span></tt>
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
 
Unexpected trailing spaces found.
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="SidekiqWorkerMethods.html#worker_options-instance_method" title="SidekiqUniqueJobs::SidekiqWorkerMethods#worker_options (method)">SidekiqWorkerMethods</a></span>
</span>
Unexpected trailing spaces found.
</h3><div class="docstring">
<div class="discussion">
<p>Wraps #get_sidekiq_options to always work with a hash</p>
 
 
</div>
</div>
<div class="tags">
Unexpected trailing spaces found.
<p class="tag_title">Returns:</p>
<ul class="return">
Unexpected trailing spaces found.
<li>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
<span class='type'>(<tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
Unexpected trailing spaces found.
Unexpected trailing spaces found.
Unexpected trailing spaces found.
&mdash;
<div class='inline'><p>of the worker class sidekiq options</p>
</div>
Unexpected trailing spaces found.
</li>
Unexpected trailing spaces found.
</ul>
 
</div>
</div>
Unexpected trailing spaces found.
</div>
 
</div>
 
<div id="footer">
Generated on Mon Sep 27 15:29:06 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>
Expected a newline at the end of the file.
</html>