doc/SidekiqUniqueJobs.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Module: SidekiqUniqueJobs
— 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";
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 (S)</a> »
<span class="title">SidekiqUniqueJobs</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>Module: SidekiqUniqueJobs
</h1>
<div class="box_info">
<dl>
<dt>Extended by:</dt>
<dd><span class='object_link'><a href="SidekiqUniqueJobs/JSON.html" title="SidekiqUniqueJobs::JSON (module)">JSON</a></span></dd>
</dl>
<dl>
<dt>Includes:</dt>
<dd><span class='object_link'><a href="SidekiqUniqueJobs/Connection.html" title="SidekiqUniqueJobs::Connection (module)">Connection</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/sidekiq_unique_jobs/constants.rb<span class="defines">,<br />
lib/sidekiq_unique_jobs/cli.rb,<br /> lib/sidekiq_unique_jobs/job.rb,<br /> lib/sidekiq_unique_jobs/key.rb,<br /> lib/sidekiq_unique_jobs/web.rb,<br /> lib/sidekiq_unique_jobs/json.rb,<br /> lib/sidekiq_unique_jobs/lock.rb,<br /> lib/sidekiq_unique_jobs/redis.rb,<br /> lib/sidekiq_unique_jobs/config.rb,<br /> lib/sidekiq_unique_jobs/script.rb,<br /> lib/sidekiq_unique_jobs/server.rb,<br /> lib/sidekiq_unique_jobs/timing.rb,<br /> lib/sidekiq_unique_jobs/digests.rb,<br /> lib/sidekiq_unique_jobs/logging.rb,<br /> lib/sidekiq_unique_jobs/version.rb,<br /> lib/sidekiq_unique_jobs/lock_ttl.rb,<br /> lib/sidekiq_unique_jobs/changelog.rb,<br /> lib/sidekiq_unique_jobs/lock_args.rb,<br /> lib/sidekiq_unique_jobs/lock_info.rb,<br /> lib/sidekiq_unique_jobs/locksmith.rb,<br /> lib/sidekiq_unique_jobs/redis/set.rb,<br /> lib/sidekiq_unique_jobs/connection.rb,<br /> lib/sidekiq_unique_jobs/exceptions.rb,<br /> lib/sidekiq_unique_jobs/middleware.rb,<br /> lib/sidekiq_unique_jobs/normalizer.rb,<br /> lib/sidekiq_unique_jobs/redis/hash.rb,<br /> lib/sidekiq_unique_jobs/redis/list.rb,<br /> lib/sidekiq_unique_jobs/timer_task.rb,<br /> lib/sidekiq_unique_jobs/unlockable.rb,<br /> lib/sidekiq_unique_jobs/deprecation.rb,<br /> lib/sidekiq_unique_jobs/lock_config.rb,<br /> lib/sidekiq_unique_jobs/lock_digest.rb,<br /> lib/sidekiq_unique_jobs/on_conflict.rb,<br /> lib/sidekiq_unique_jobs/reflectable.rb,<br /> lib/sidekiq_unique_jobs/reflections.rb,<br /> lib/sidekiq_unique_jobs/web/helpers.rb,<br /> lib/sidekiq_unique_jobs/batch_delete.rb,<br /> lib/sidekiq_unique_jobs/lock_timeout.rb,<br /> lib/sidekiq_unique_jobs/redis/entity.rb,<br /> lib/sidekiq_unique_jobs/redis/string.rb,<br /> lib/sidekiq_unique_jobs/script/caller.rb,<br /> lib/sidekiq_unique_jobs/upgrade_locks.rb,<br /> lib/sidekiq_unique_jobs/version_check.rb,<br /> lib/sidekiq_unique_jobs/lock/base_lock.rb,<br /> lib/sidekiq_unique_jobs/lock/validator.rb,<br /> lib/sidekiq_unique_jobs/orphans/reaper.rb,<br /> lib/sidekiq_unique_jobs/rspec/matchers.rb,<br /> lib/sidekiq_unique_jobs/update_version.rb,<br /> lib/sidekiq_unique_jobs/on_conflict/log.rb,<br /> lib/sidekiq_unique_jobs/orphans/manager.rb,<br /> lib/sidekiq_unique_jobs/orphans/observer.rb,<br /> lib/sidekiq_unique_jobs/redis/sorted_set.rb,<br /> lib/sidekiq_unique_jobs/middleware/client.rb,<br /> lib/sidekiq_unique_jobs/middleware/server.rb,<br /> lib/sidekiq_unique_jobs/on_conflict/raise.rb,<br /> lib/sidekiq_unique_jobs/lock/until_expired.rb,<br /> lib/sidekiq_unique_jobs/on_conflict/reject.rb,<br /> lib/sidekiq_unique_jobs/orphans/lua_reaper.rb,<br /> lib/sidekiq_unique_jobs/lock/until_executed.rb,<br /> lib/sidekiq_unique_jobs/on_conflict/replace.rb,<br /> lib/sidekiq_unique_jobs/orphans/null_reaper.rb,<br /> lib/sidekiq_unique_jobs/orphans/ruby_reaper.rb,<br /> lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb,<br /> lib/sidekiq_unique_jobs/lock/until_executing.rb,<br /> lib/sidekiq_unique_jobs/lock/while_executing.rb,<br /> lib/sidekiq_unique_jobs/on_conflict/strategy.rb,<br /> lib/sidekiq_unique_jobs/lock/client_validator.rb,<br /> lib/sidekiq_unique_jobs/lock/server_validator.rb,<br /> lib/sidekiq_unique_jobs/options_with_fallback.rb,<br /> lib/sidekiq_unique_jobs/on_conflict/reschedule.rb,<br /> lib/sidekiq_unique_jobs/sidekiq_worker_methods.rb,<br /> lib/sidekiq_unique_jobs/on_conflict/null_strategy.rb,<br /> lib/sidekiq_unique_jobs/logging/middleware_context.rb,<br /> lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb,<br /> lib/sidekiq_unique_jobs/lock/while_executing_reject.rb,<br /> lib/sidekiq_unique_jobs/lock/until_and_while_executing.rb,<br /> lib/sidekiq_unique_jobs/rspec/matchers/have_valid_sidekiq_options.rb</span>
</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Contains configuration and utility methods that belongs top level</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><h2>Defined Under Namespace</h2>
<p class="children">
<strong class="modules">Modules:</strong> <span class='object_link'><a href="SidekiqUniqueJobs/Connection.html" title="SidekiqUniqueJobs::Connection (module)">Connection</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/JSON.html" title="SidekiqUniqueJobs::JSON (module)">JSON</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Job.html" title="SidekiqUniqueJobs::Job (module)">Job</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Logging.html" title="SidekiqUniqueJobs::Logging (module)">Logging</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Middleware.html" title="SidekiqUniqueJobs::Middleware (module)">Middleware</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Normalizer.html" title="SidekiqUniqueJobs::Normalizer (module)">Normalizer</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/OnConflict.html" title="SidekiqUniqueJobs::OnConflict (module)">OnConflict</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/OptionsWithFallback.html" title="SidekiqUniqueJobs::OptionsWithFallback (module)">OptionsWithFallback</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Orphans.html" title="SidekiqUniqueJobs::Orphans (module)">Orphans</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/RSpec.html" title="SidekiqUniqueJobs::RSpec (module)">RSpec</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Redis.html" title="SidekiqUniqueJobs::Redis (module)">Redis</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Reflectable.html" title="SidekiqUniqueJobs::Reflectable (module)">Reflectable</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Script.html" title="SidekiqUniqueJobs::Script (module)">Script</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/SidekiqWorkerMethods.html" title="SidekiqUniqueJobs::SidekiqWorkerMethods (module)">SidekiqWorkerMethods</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Timing.html" title="SidekiqUniqueJobs::Timing (module)">Timing</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Unlockable.html" title="SidekiqUniqueJobs::Unlockable (module)">Unlockable</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Web.html" title="SidekiqUniqueJobs::Web (module)">Web</a></span>
<strong class="classes">Classes:</strong> <span class='object_link'><a href="SidekiqUniqueJobs/BatchDelete.html" title="SidekiqUniqueJobs::BatchDelete (class)">BatchDelete</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Changelog.html" title="SidekiqUniqueJobs::Changelog (class)">Changelog</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Cli.html" title="SidekiqUniqueJobs::Cli (class)">Cli</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Config.html" title="SidekiqUniqueJobs::Config (class)">Config</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Conflict.html" title="SidekiqUniqueJobs::Conflict (class)">Conflict</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Deprecation.html" title="SidekiqUniqueJobs::Deprecation (class)">Deprecation</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Digests.html" title="SidekiqUniqueJobs::Digests (class)">Digests</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/DuplicateLock.html" title="SidekiqUniqueJobs::DuplicateLock (class)">DuplicateLock</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/DuplicateStrategy.html" title="SidekiqUniqueJobs::DuplicateStrategy (class)">DuplicateStrategy</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/InvalidArgument.html" title="SidekiqUniqueJobs::InvalidArgument (class)">InvalidArgument</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/InvalidUniqueArguments.html" title="SidekiqUniqueJobs::InvalidUniqueArguments (class)">InvalidUniqueArguments</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/InvalidWorker.html" title="SidekiqUniqueJobs::InvalidWorker (class)">InvalidWorker</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Key.html" title="SidekiqUniqueJobs::Key (class)">Key</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Lock.html" title="SidekiqUniqueJobs::Lock (class)">Lock</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/LockArgs.html" title="SidekiqUniqueJobs::LockArgs (class)">LockArgs</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/LockConfig.html" title="SidekiqUniqueJobs::LockConfig (class)">LockConfig</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/LockDigest.html" title="SidekiqUniqueJobs::LockDigest (class)">LockDigest</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/LockInfo.html" title="SidekiqUniqueJobs::LockInfo (class)">LockInfo</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/LockTTL.html" title="SidekiqUniqueJobs::LockTTL (class)">LockTTL</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/LockTimeout.html" title="SidekiqUniqueJobs::LockTimeout (class)">LockTimeout</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Locksmith.html" title="SidekiqUniqueJobs::Locksmith (class)">Locksmith</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/NoBlockGiven.html" title="SidekiqUniqueJobs::NoBlockGiven (class)">NoBlockGiven</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/NoSuchNotificationError.html" title="SidekiqUniqueJobs::NoSuchNotificationError (class)">NoSuchNotificationError</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/NotUniqueWorker.html" title="SidekiqUniqueJobs::NotUniqueWorker (class)">NotUniqueWorker</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Reflections.html" title="SidekiqUniqueJobs::Reflections (class)">Reflections</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/Server.html" title="SidekiqUniqueJobs::Server (class)">Server</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/TimerTask.html" title="SidekiqUniqueJobs::TimerTask (class)">TimerTask</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/UniqueJobsError.html" title="SidekiqUniqueJobs::UniqueJobsError (class)">UniqueJobsError</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/UnknownLock.html" title="SidekiqUniqueJobs::UnknownLock (class)">UnknownLock</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/UpdateVersion.html" title="SidekiqUniqueJobs::UpdateVersion (class)">UpdateVersion</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/UpgradeLocks.html" title="SidekiqUniqueJobs::UpgradeLocks (class)">UpgradeLocks</a></span>, <span class='object_link'><a href="SidekiqUniqueJobs/VersionCheck.html" title="SidekiqUniqueJobs::VersionCheck (class)">VersionCheck</a></span>
</p>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="ThreadSafeConfig-constant" class="">ThreadSafeConfig =
<div class="docstring">
<div class="discussion">
<p>ThreadSafe config exists to be able to document the config class without errors</p>
</div>
</div>
<div class="tags">
</div>
</dt>
<dd><pre class="code"><span class='const'>Concurrent</span><span class='op'>::</span><span class='const'>MutableStruct</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ThreadSafeConfig</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='symbol'>:lock_timeout</span><span class='comma'>,</span>
<span class='symbol'>:lock_ttl</span><span class='comma'>,</span>
<span class='symbol'>:enabled</span><span class='comma'>,</span>
<span class='symbol'>:lock_prefix</span><span class='comma'>,</span>
<span class='symbol'>:logger</span><span class='comma'>,</span>
<span class='symbol'>:locks</span><span class='comma'>,</span>
<span class='symbol'>:strategies</span><span class='comma'>,</span>
<span class='symbol'>:debug_lua</span><span class='comma'>,</span>
<span class='symbol'>:max_history</span><span class='comma'>,</span>
<span class='symbol'>:reaper</span><span class='comma'>,</span>
<span class='symbol'>:reaper_count</span><span class='comma'>,</span>
<span class='symbol'>:reaper_interval</span><span class='comma'>,</span>
<span class='symbol'>:reaper_timeout</span><span class='comma'>,</span>
<span class='symbol'>:reaper_resurrector_interval</span><span class='comma'>,</span>
<span class='symbol'>:reaper_resurrector_enabled</span><span class='comma'>,</span>
<span class='symbol'>:lock_info</span><span class='comma'>,</span>
<span class='symbol'>:raise_on_config_error</span><span class='comma'>,</span>
<span class='symbol'>:current_redis_version</span><span class='rparen'>)</span></pre></dd>
<dt id="VERSION-constant" class="">VERSION =
<div class="docstring">
<div class="discussion">
<p>Returns the current SidekiqUniqueJobs version.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
—
<div class='inline'><p>the current SidekiqUniqueJobs version</p>
</div>
</li>
</ul>
</div>
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>7.1.7</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="ARGS-constant" class="">ARGS =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>args</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="APARTMENT-constant" class="">APARTMENT =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>apartment</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="AT-constant" class="">AT =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>at</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="CHANGELOGS-constant" class="">CHANGELOGS =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>uniquejobs:changelog</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="CLASS-constant" class="">CLASS =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>class</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="CREATED_AT-constant" class="">CREATED_AT =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>created_at</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="DEAD_VERSION-constant" class="">DEAD_VERSION =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>uniquejobs:dead</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="DIGESTS-constant" class="">DIGESTS =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>uniquejobs:digests</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="ERRORS-constant" class="">ERRORS =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>errors</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="JID-constant" class="">JID =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>jid</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LIMIT-constant" class="">LIMIT =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>limit</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LIVE_VERSION-constant" class="">LIVE_VERSION =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>uniquejobs:live</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LOCK-constant" class="">LOCK =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>lock</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LOCK_ARGS-constant" class="">LOCK_ARGS =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>lock_args</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LOCK_ARGS_METHOD-constant" class="">LOCK_ARGS_METHOD =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>lock_args_method</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LOCK_DIGEST-constant" class="">LOCK_DIGEST =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>lock_digest</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LOCK_EXPIRATION-constant" class="">LOCK_EXPIRATION =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>lock_expiration</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LOCK_INFO-constant" class="">LOCK_INFO =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>lock_info</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LOCK_LIMIT-constant" class="">LOCK_LIMIT =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>lock_limit</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LOCK_PREFIX-constant" class="">LOCK_PREFIX =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>lock_prefix</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LOCK_TIMEOUT-constant" class="">LOCK_TIMEOUT =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>lock_timeout</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LOCK_TTL-constant" class="">LOCK_TTL =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>lock_ttl</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="LOCK_TYPE-constant" class="">LOCK_TYPE =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>lock_type</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="ON_CLIENT_CONFLICT-constant" class="">ON_CLIENT_CONFLICT =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>on_client_conflict</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="ON_CONFLICT-constant" class="">ON_CONFLICT =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>on_conflict</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="ON_SERVER_CONFLICT-constant" class="">ON_SERVER_CONFLICT =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>on_server_conflict</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="PAYLOAD-constant" class="">PAYLOAD =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>payload</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="PROCESSES-constant" class="">PROCESSES =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>processes</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="QUEUE-constant" class="">QUEUE =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>queue</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="RETRY-constant" class="">RETRY =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>retry</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="SCHEDULE-constant" class="">SCHEDULE =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>schedule</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="TIME-constant" class="">TIME =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>time</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="TIMEOUT-constant" class="">TIMEOUT =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>timeout</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="TTL-constant" class="">TTL =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ttl</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="TYPE-constant" class="">TYPE =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>type</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="UNIQUE-constant" class="">UNIQUE =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unique</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="UNIQUE_ACROSS_QUEUES-constant" class="">UNIQUE_ACROSS_QUEUES =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unique_across_queues</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="UNIQUE_ACROSS_WORKERS-constant" class="">UNIQUE_ACROSS_WORKERS =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unique_across_workers</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="UNIQUE_ARGS-constant" class="">UNIQUE_ARGS =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unique_args</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="UNIQUE_ARGS_METHOD-constant" class="">UNIQUE_ARGS_METHOD =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unique_args_method</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="UNIQUE_DIGEST-constant" class="">UNIQUE_DIGEST =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unique_digest</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="UNIQUE_PREFIX-constant" class="">UNIQUE_PREFIX =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unique_prefix</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="UNIQUE_REAPER-constant" class="">UNIQUE_REAPER =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>uniquejobs:reaper</span><span class='tstring_end'>"</span></span></pre></dd>
<dt id="WORKER-constant" class="">WORKER =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>worker</span><span class='tstring_end'>"</span></span></pre></dd>
</dl>
<h2>
Class Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#config-class_method" title="config (class method)">.<strong>config</strong> ⇒ SidekiqUniqueJobs::Config </a>
</span>
<span class="summary_desc"><div class='inline'><p>The current configuration (See: <span class='object_link'><a href="#configure-class_method" title="SidekiqUniqueJobs.configure (method)">SidekiqUniqueJobs.configure</a></span> on how to configure).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#configure-class_method" title="configure (class method)">.<strong>configure</strong>(options = {}) { ... } ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'><p>Configure the gem.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#constantize-class_method" title="constantize (class method)">.<strong>constantize</strong>(str) ⇒ Sidekiq::Worker </a>
</span>
<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't be found.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#disable!-class_method" title="disable! (class method)">.<strong>disable!</strong>(&block) ⇒ false, true </a>
</span>
<span class="summary_desc"><div class='inline'><p>Disable SidekiqUniuqeJobs either temporarily in a block or for good.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#disabled%3F-class_method" title="disabled? (class method)">.<strong>disabled?</strong> ⇒ true, false </a>
</span>
<span class="summary_desc"><div class='inline'><p>Checks if the gem has been disabled.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#enable!-class_method" title="enable! (class method)">.<strong>enable!</strong>(&block) ⇒ true, false </a>
</span>
<span class="summary_desc"><div class='inline'><p>Enable SidekiqUniuqeJobs either temporarily in a block or for good.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#enabled%3F-class_method" title="enabled? (class method)">.<strong>enabled?</strong> ⇒ true, false </a>
</span>
<span class="summary_desc"><div class='inline'><p>Checks if the gem has been disabled.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#fetch_redis_version-class_method" title="fetch_redis_version (class method)">.<strong>fetch_redis_version</strong> ⇒ String </a>
</span>
<span class="summary_desc"><div class='inline'><p>Returns the current redis version.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#locks-class_method" title="locks (class method)">.<strong>locks</strong> ⇒ Hash<Symbol, SidekiqUniqueJobs::BaseLock> </a>
</span>
<span class="summary_desc"><div class='inline'><p>The current locks.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#logger-class_method" title="logger (class method)">.<strong>logger</strong> ⇒ Logger </a>
</span>
<span class="summary_desc"><div class='inline'><p>The current logger.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#logger=-class_method" title="logger= (class method)">.<strong>logger=</strong>(other) ⇒ Logger </a>
</span>
<span class="summary_desc"><div class='inline'><p>Set a new logger.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#now-class_method" title="now (class method)">.<strong>now</strong> ⇒ Time </a>
</span>
<span class="summary_desc"><div class='inline'><p>Current time.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#now_f-class_method" title="now_f (class method)">.<strong>now_f</strong> ⇒ Float </a>
</span>
<span class="summary_desc"><div class='inline'><p>Current time as float.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#reflect-class_method" title="reflect (class method)">.<strong>reflect</strong> {|x| ... } ⇒ void </a>
</span>
<span class="summary_desc"><div class='inline'><p>Yields notification stack for sidekiq unique jobs to configure notifications.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#reflections-class_method" title="reflections (class method)">.<strong>reflections</strong> ⇒ Reflections </a>
</span>
<span class="summary_desc"><div class='inline'><p>Collection with notifications.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#reset!-class_method" title="reset! (class method)">.<strong>reset!</strong> ⇒ SidekiqUniqueJobs::Config </a>
</span>
<span class="summary_desc"><div class='inline'><p>Resets configuration to deafult.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#safe_constantize-class_method" title="safe_constantize (class method)">.<strong>safe_constantize</strong>(str) ⇒ Sidekiq::Worker, String </a>
</span>
<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't be found.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#strategies-class_method" title="strategies (class method)">.<strong>strategies</strong> ⇒ Hash<Symbol, SidekiqUniqueJobs::Strategy> </a>
</span>
<span class="summary_desc"><div class='inline'><p>The current strategies.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#toggle-class_method" title="toggle (class method)">.<strong>toggle</strong>(enabled) ⇒ Object </a>
</span>
<span class="private note title">private</span>
<span class="summary_desc"><div class='inline'><p>Toggles enabled on or off.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#use_config-class_method" title="use_config (class method)">.<strong>use_config</strong>(tmp_config = {}) { ... } ⇒ void </a>
</span>
<span class="summary_desc"><div class='inline'><p>Temporarily use another configuration and reset to the old config after yielding.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#validate_worker-class_method" title="validate_worker (class method)">.<strong>validate_worker</strong>(options) ⇒ Boolean </a>
</span>
<span class="summary_desc"><div class='inline'><p>Checks that the worker is valid with the given options.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#validate_worker!-class_method" title="validate_worker! (class method)">.<strong>validate_worker!</strong>(options) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'><p>Checks that the worker is valid with the given options.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#version-class_method" title="version (class method)">.<strong>version</strong> ⇒ String </a>
</span>
<span class="summary_desc"><div class='inline'><p>The current gem version.</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="#redis-instance_method" title="#redis (instance method)">#<strong>redis</strong>(r_pool = nil, &block) ⇒ Sidekiq::RedisConnection, ConnectionPool </a>
</span>
<span class="note title not_defined_here">
included
from <span class='object_link'><a href="SidekiqUniqueJobs/Connection.html#redis-instance_method" title="SidekiqUniqueJobs::Connection#redis (method)">Connection</a></span>
</span>
<span class="summary_desc"><div class='inline'><p>Creates a connection to redis.</p>
</div></span>
</li>
</ul>
<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="config-class_method">
.<strong>config</strong> ⇒ <tt><span class='object_link'><a href="SidekiqUniqueJobs/Config.html" title="SidekiqUniqueJobs::Config (class)">SidekiqUniqueJobs::Config</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>The current configuration (See: <span class='object_link'><a href="#configure-class_method" title="SidekiqUniqueJobs.configure (method)">configure</a></span> on how to configure)</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="SidekiqUniqueJobs/Config.html" title="SidekiqUniqueJobs::Config (class)">SidekiqUniqueJobs::Config</a></span></tt>)</span>
—
<div class='inline'><p>the gem configuration</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
19
20
21</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 19</span>
<span class='kw'>def</span> <span class='id identifier rubyid_config'>config</span>
<span class='ivar'>@config</span> <span class='op'>||=</span> <span class='id identifier rubyid_reset!'>reset!</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="configure-class_method">
.<strong>configure</strong>(options = {}) { ... } ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Configure the gem</p>
<p>This is usually called once at startup of an application</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>options</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>{}</tt>)</em>
—
<div class='inline'><p>global gem options</p>
</div>
</li>
</ul>
<p class="tag_title">Options Hash (<tt>options</tt>):</p>
<ul class="option">
<li>
<span class="name">:lock_timeout</span>
<span class="type">(<tt>Integer</tt>)</span>
<span class="default">
— default:
<tt>default is 0</tt>
</span>
</li>
<li>
<span class="name">:lock_ttl</span>
<span class="type">(<tt>Integer</tt>)</span>
<span class="default">
— default:
<tt>default is 0</tt>
</span>
</li>
<li>
<span class="name">:enabled</span>
<span class="type">(<tt>true</tt>, <tt>false</tt>)</span>
<span class="default">
— default:
<tt>default is true</tt>
</span>
</li>
<li>
<span class="name">:lock_prefix</span>
<span class="type">(<tt>String</tt>)</span>
<span class="default">
— default:
<tt>default is 'uniquejobs'</tt>
</span>
</li>
<li>
<span class="name">:logger</span>
<span class="type">(<tt>Logger</tt>)</span>
<span class="default">
— default:
<tt>default is Sidekiq.logger</tt>
</span>
</li>
</ul>
<p class="tag_title">Yields:</p>
<ul class="yield">
<li>
<span class='type'></span>
<div class='inline'><p>control to the caller when given block</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
174
175
176
177
178
179
180
181
182</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 174</span>
<span class='kw'>def</span> <span class='id identifier rubyid_configure'>configure</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
<span class='kw'>yield</span> <span class='id identifier rubyid_config'>config</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_val'>val</span><span class='op'>|</span>
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_val'>val</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="constantize-class_method">
.<strong>constantize</strong>(str) ⇒ <tt><span class='object_link'><a href="Sidekiq/Worker.html" title="Sidekiq::Worker (module)">Sidekiq::Worker</a></span></tt>
</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't be found</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="Sidekiq/Worker.html" title="Sidekiq::Worker (module)">Sidekiq::Worker</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
244
245
246
247
248
249
250
251
252
253
254
255
256
257</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 244</span>
<span class='kw'>def</span> <span class='id identifier rubyid_constantize'>constantize</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='kw'>if</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Sidekiq.html" title="Sidekiq (module)">Sidekiq</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Sidekiq/Worker.html" title="Sidekiq::Worker (module)">Worker</a></span></span><span class='rparen'>)</span> <span class='comment'># sidekiq v6.x
</span> <span class='kw'>return</span> <span class='id identifier rubyid_str'>str</span> <span class='kw'>unless</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>::</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>::</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_names'>names</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span> <span class='kw'>if</span> <span class='id identifier rubyid_names'>names</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>||</span> <span class='id identifier rubyid_names'>names</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_names'>names</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='const'>Object</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_constant'>constant</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='op'>|</span>
<span class='comment'># the false flag limits search for name to under the constant namespace
</span> <span class='comment'># which mimics Rails' behaviour
</span> <span class='id identifier rubyid_constant'>constant</span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='kw'>false</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="disable!-class_method">
.<strong>disable!</strong>(&block) ⇒ <tt>false</tt>, <tt>true</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Disable SidekiqUniuqeJobs either temporarily in a block or for good</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>temporarily disable sidekiq unique jobs while executing a block of code</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>false</tt>)</span>
—
<div class='inline'><p>when not given a block</p>
</div>
</li>
<li>
<span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
—
<div class='inline'><p>the previous value of enable when given a block</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
124
125
126</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 124</span>
<span class='kw'>def</span> <span class='id identifier rubyid_disable!'>disable!</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='id identifier rubyid_toggle'>toggle</span><span class='lparen'>(</span><span class='kw'>false</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="disabled?-class_method">
.<strong>disabled?</strong> ⇒ <tt>true</tt>, <tt>false</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks if the gem has been disabled</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 config.enabled is false</p>
</div>
</li>
<li>
<span class='type'>(<tt>false</tt>)</span>
—
<div class='inline'><p>when config.enabled is true</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
144
145
146</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 144</span>
<span class='kw'>def</span> <span class='id identifier rubyid_disabled?'>disabled?</span>
<span class='op'>!</span><span class='id identifier rubyid_enabled?'>enabled?</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="enable!-class_method">
.<strong>enable!</strong>(&block) ⇒ <tt>true</tt>, <tt>false</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Enable SidekiqUniuqeJobs either temporarily in a block or for good</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>temporarily enable sidekiq unique jobs while executing a block of code</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>true</tt>)</span>
—
<div class='inline'><p>when not given a block</p>
</div>
</li>
<li>
<span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
—
<div class='inline'><p>the previous value of enable when given a block</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
112
113
114</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 112</span>
<span class='kw'>def</span> <span class='id identifier rubyid_enable!'>enable!</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='id identifier rubyid_toggle'>toggle</span><span class='lparen'>(</span><span class='kw'>true</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="enabled?-class_method">
.<strong>enabled?</strong> ⇒ <tt>true</tt>, <tt>false</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks if the gem has been disabled</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 config.enabled is true</p>
</div>
</li>
<li>
<span class='type'>(<tt>false</tt>)</span>
—
<div class='inline'><p>when config.enabled is false</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
134
135
136</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 134</span>
<span class='kw'>def</span> <span class='id identifier rubyid_enabled?'>enabled?</span>
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_enabled'>enabled</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="fetch_redis_version-class_method">
.<strong>fetch_redis_version</strong> ⇒ <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the current redis version</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
—
<div class='inline'><p>a string like <code>5.0.2</code></p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
190
191
192</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 190</span>
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_redis_version'>fetch_redis_version</span>
<span class='const'><span class='object_link'><a href="Sidekiq.html" title="Sidekiq (module)">Sidekiq</a></span></span><span class='period'>.</span><span class='id identifier rubyid_redis_info'>redis_info</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>redis_version</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="locks-class_method">
.<strong>locks</strong> ⇒ <tt><span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span><Symbol, SidekiqUniqueJobs::BaseLock></tt>
</h3><div class="docstring">
<div class="discussion">
<p>The current locks</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><Symbol, SidekiqUniqueJobs::BaseLock></tt>)</span>
—
<div class='inline'><p>the configured locks</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
39
40
41</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 39</span>
<span class='kw'>def</span> <span class='id identifier rubyid_locks'>locks</span>
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_locks'>locks</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="logger-class_method">
.<strong>logger</strong> ⇒ <tt>Logger</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The current logger</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Logger</tt>)</span>
—
<div class='inline'><p>the configured logger</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
49
50
51</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 49</span>
<span class='kw'>def</span> <span class='id identifier rubyid_logger'>logger</span>
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="logger=-class_method">
.<strong>logger=</strong>(other) ⇒ <tt>Logger</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Set a new logger</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>other</span>
<span class='type'>(<tt>Logger</tt>)</span>
—
<div class='inline'><p>another logger</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Logger</tt>)</span>
—
<div class='inline'><p>the new logger</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/sidekiq_unique_jobs.rb', line 70</span>
<span class='kw'>def</span> <span class='id identifier rubyid_logger='>logger=</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span> <span class='op'>=</span> <span class='id identifier rubyid_other'>other</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="now-class_method">
.<strong>now</strong> ⇒ <tt>Time</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Current time</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Time</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
210
211
212</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 210</span>
<span class='kw'>def</span> <span class='id identifier rubyid_now'>now</span>
<span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="now_f-class_method">
.<strong>now_f</strong> ⇒ <tt>Float</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Current time as float</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Float</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
200
201
202</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 200</span>
<span class='kw'>def</span> <span class='id identifier rubyid_now_f'>now_f</span>
<span class='id identifier rubyid_now'>now</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="reflect-class_method">
.<strong>reflect</strong> {|x| ... } ⇒ <tt>void</tt>
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p><p>Yields notification stack for sidekiq unique jobs to configure notifications</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Yield Parameters:</p>
<ul class="yieldparam">
<li>
<span class='name'>x</span>
<span class='type'>(<tt><span class='object_link'><a href="SidekiqUniqueJobs/Reflections.html" title="SidekiqUniqueJobs::Reflections (class)">Reflections</a></span></tt>)</span>
—
<div class='inline'><p>used to configure notifications</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
291
292
293</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 291</span>
<span class='kw'>def</span> <span class='id identifier rubyid_reflect'>reflect</span>
<span class='kw'>yield</span> <span class='id identifier rubyid_reflections'>reflections</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="reflections-class_method">
.<strong>reflections</strong> ⇒ <tt><span class='object_link'><a href="SidekiqUniqueJobs/Reflections.html" title="SidekiqUniqueJobs::Reflections (class)">Reflections</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Collection with notifications</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="SidekiqUniqueJobs/Reflections.html" title="SidekiqUniqueJobs::Reflections (class)">Reflections</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
280
281
282</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 280</span>
<span class='kw'>def</span> <span class='id identifier rubyid_reflections'>reflections</span>
<span class='ivar'>@reflections</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="SidekiqUniqueJobs/Reflections.html" title="SidekiqUniqueJobs::Reflections (class)">Reflections</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="SidekiqUniqueJobs/Reflections.html#initialize-instance_method" title="SidekiqUniqueJobs::Reflections#initialize (method)">new</a></span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="reset!-class_method">
.<strong>reset!</strong> ⇒ <tt><span class='object_link'><a href="SidekiqUniqueJobs/Config.html" title="SidekiqUniqueJobs::Config (class)">SidekiqUniqueJobs::Config</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Resets configuration to deafult</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="SidekiqUniqueJobs/Config.html" title="SidekiqUniqueJobs::Config (class)">SidekiqUniqueJobs::Config</a></span></tt>)</span>
—
<div class='inline'><p>a default gem configuration</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
100
101
102</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 100</span>
<span class='kw'>def</span> <span class='id identifier rubyid_reset!'>reset!</span>
<span class='ivar'>@config</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="SidekiqUniqueJobs/Config.html" title="SidekiqUniqueJobs::Config (class)">Config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_default'><span class='object_link'><a href="SidekiqUniqueJobs/Config.html#default-class_method" title="SidekiqUniqueJobs::Config.default (method)">default</a></span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="safe_constantize-class_method">
.<strong>safe_constantize</strong>(str) ⇒ <tt><span class='object_link'><a href="Sidekiq/Worker.html" title="Sidekiq::Worker (module)">Sidekiq::Worker</a></span></tt>, <tt>String</tt>
</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't be found</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="Sidekiq/Worker.html" title="Sidekiq::Worker (module)">Sidekiq::Worker</a></span></tt>, <tt>String</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
263
264
265
266
267
268
269
270
271
272</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 263</span>
<span class='kw'>def</span> <span class='id identifier rubyid_safe_constantize'>safe_constantize</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span>
<span class='id identifier rubyid_constantize'>constantize</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'>NameError</span> <span class='op'>=></span> <span class='id identifier rubyid_ex'>ex</span>
<span class='kw'>case</span> <span class='id identifier rubyid_ex'>ex</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span>
<span class='kw'>when</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>uninitialized constant</span><span class='regexp_end'>/</span></span>
<span class='id identifier rubyid_str'>str</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_raise'>raise</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="strategies-class_method">
.<strong>strategies</strong> ⇒ <tt><span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span><Symbol, SidekiqUniqueJobs::Strategy></tt>
</h3><div class="docstring">
<div class="discussion">
<p>The current strategies</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><Symbol, SidekiqUniqueJobs::Strategy></tt>)</span>
—
<div class='inline'><p>the configured locks</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
29
30
31</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 29</span>
<span class='kw'>def</span> <span class='id identifier rubyid_strategies'>strategies</span>
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_strategies'>strategies</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="toggle-class_method">
.<strong>toggle</strong>(enabled) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p class="note private">
<strong>This method is part of a private API.</strong>
You should avoid using this method if possible, as it may be removed or be changed in the future.
</p>
<p>Toggles enabled on or off</p>
<p>:nodoc:</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
153
154
155
156
157
158
159
160
161
162</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 153</span>
<span class='kw'>def</span> <span class='id identifier rubyid_toggle'>toggle</span><span class='lparen'>(</span><span class='id identifier rubyid_enabled'>enabled</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
<span class='id identifier rubyid_enabled_was'>enabled_was</span> <span class='op'>=</span> <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_enabled'>enabled</span>
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_enabled'>enabled</span> <span class='op'>=</span> <span class='id identifier rubyid_enabled'>enabled</span>
<span class='kw'>yield</span>
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_enabled'>enabled</span> <span class='op'>=</span> <span class='id identifier rubyid_enabled_was'>enabled_was</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_enabled'>enabled</span> <span class='op'>=</span> <span class='id identifier rubyid_enabled'>enabled</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="use_config-class_method">
.<strong>use_config</strong>(tmp_config = {}) { ... } ⇒ <tt>void</tt>
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p><p>Temporarily use another configuration and reset to the old config after yielding</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>tmp_config</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>{}</tt>)</em>
—
<div class='inline'><p>the temporary configuration to use</p>
</div>
</li>
</ul>
<p class="tag_title">Yields:</p>
<ul class="yield">
<li>
<span class='type'></span>
<div class='inline'><p>control to the caller</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
82
83
84
85
86
87
88
89
90
91
92</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 82</span>
<span class='kw'>def</span> <span class='id identifier rubyid_use_config'>use_config</span><span class='lparen'>(</span><span class='id identifier rubyid_tmp_config'>tmp_config</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='op'>::</span><span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid___method__'>__method__</span><span class='embexpr_end'>}</span><span class='tstring_content'> needs a block</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
<span class='id identifier rubyid_old_config'>old_config</span> <span class='op'>=</span> <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span>
<span class='id identifier rubyid_reset!'>reset!</span>
<span class='id identifier rubyid_configure'>configure</span><span class='lparen'>(</span><span class='id identifier rubyid_tmp_config'>tmp_config</span><span class='rparen'>)</span>
<span class='kw'>yield</span>
<span class='kw'>ensure</span>
<span class='id identifier rubyid_reset!'>reset!</span>
<span class='id identifier rubyid_configure'>configure</span><span class='lparen'>(</span><span class='id identifier rubyid_old_config'>old_config</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="validate_worker-class_method">
.<strong>validate_worker</strong>(options) ⇒ <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks that the worker is valid with the given options</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>options</span>
<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 <code>sidekiq_options</code> to validate</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
</li>
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt><span class='object_link'><a href="SidekiqUniqueJobs/NotUniqueWorker.html" title="SidekiqUniqueJobs::NotUniqueWorker (class)">NotUniqueWorker</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
221
222
223
224
225
226</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 221</span>
<span class='kw'>def</span> <span class='id identifier rubyid_validate_worker'>validate_worker</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="SidekiqUniqueJobs/NotUniqueWorker.html" title="SidekiqUniqueJobs::NotUniqueWorker (class)">NotUniqueWorker</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='kw'>unless</span> <span class='lparen'>(</span><span class='id identifier rubyid_lock_type'>lock_type</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#LOCK-constant" title="SidekiqUniqueJobs::LOCK (constant)">LOCK</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='id identifier rubyid_lock_class'>lock_class</span> <span class='op'>=</span> <span class='id identifier rubyid_locks'>locks</span><span class='lbracket'>[</span><span class='id identifier rubyid_lock_type'>lock_type</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_lock_class'>lock_class</span><span class='period'>.</span><span class='id identifier rubyid_validate_options'>validate_options</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="validate_worker!-class_method">
.<strong>validate_worker!</strong>(options) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks that the worker is valid with the given options</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>options</span>
<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 <code>sidekiq_options</code> to validate</p>
</div>
</li>
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt><span class='object_link'><a href="SidekiqUniqueJobs/InvalidWorker.html" title="SidekiqUniqueJobs::InvalidWorker (class)">InvalidWorker</a></span></tt>)</span>
—
<div class='inline'><p>when <span class='object_link'>#validate_worker</span> returns false or nil</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
235
236
237
238</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 235</span>
<span class='kw'>def</span> <span class='id identifier rubyid_validate_worker!'>validate_worker!</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='id identifier rubyid_lock_config'>lock_config</span> <span class='op'>=</span> <span class='id identifier rubyid_validate_worker'>validate_worker</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="SidekiqUniqueJobs/InvalidWorker.html" title="SidekiqUniqueJobs::InvalidWorker (class)">InvalidWorker</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_lock_config'>lock_config</span> <span class='kw'>unless</span> <span class='id identifier rubyid_lock_config'>lock_config</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="version-class_method">
.<strong>version</strong> ⇒ <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The current gem version</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
—
<div class='inline'><p>the current gem version</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
59
60
61</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb', line 59</span>
<span class='kw'>def</span> <span class='id identifier rubyid_version'>version</span>
<span class='const'><span class='object_link'><a href="#VERSION-constant" title="SidekiqUniqueJobs::VERSION (constant)">VERSION</a></span></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="redis-instance_method">
#<strong>redis</strong>(r_pool = nil, &block) ⇒ <tt>Sidekiq::RedisConnection</tt>, <tt>ConnectionPool</tt>
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="SidekiqUniqueJobs/Connection.html#redis-instance_method" title="SidekiqUniqueJobs::Connection#redis (method)">Connection</a></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p>Creates a connection to redis</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Sidekiq::RedisConnection</tt>, <tt>ConnectionPool</tt>)</span>
—
<div class='inline'><p>a connection to redis</p>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Sep 27 15:29:05 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>