mhenrixon/sidekiq-unique-jobs

View on GitHub
doc/SidekiqUniqueJobs/RedisScript/Scripts.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::RedisScript::Scripts
  
    &mdash; Documentation by YARD 0.9.34
  
</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::RedisScript::Scripts";
  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> &raquo;
    <span class='title'><span class='object_link'><a href="../../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../RedisScript.html" title="SidekiqUniqueJobs::RedisScript (module)">RedisScript</a></span></span>
     &raquo; 
    <span class="title">Scripts</span>
  
</div>

        <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="../../class_list.html">

        <svg width="24" height="24">
          <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
          <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
          <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
        </svg>
    </a>
  
</div>
        <div class="clear"></div>
      </div>

      <div id="content"><h1>Class: SidekiqUniqueJobs::RedisScript::Scripts
  
  
  
</h1>
<div class="box_info">
  
  <dl>
    <dt>Inherits:</dt>
    <dd>
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">SidekiqUniqueJobs::RedisScript::Scripts</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
    </dd>
  </dl>
  

  
  
  
  
  

  

  
  <dl>
    <dt>Defined in:</dt>
    <dd>lib/sidekiq_unique_jobs/redis_script/scripts.rb</dd>
  </dl>
  
</div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>Interface to dealing with .lua files</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>
      Constant Summary
      <small><a href="#" class="constants_summary_toggle">collapse</a></small>
    </h2>

    <dl class="constants">
      
        <dt id="SCRIPT_PATHS-constant" class="">SCRIPT_PATHS =
          <div class="docstring">
  <div class="discussion">
    <p>Returns a map with configured script paths.</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Concurrent::Map</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>a map with configured script paths</p>
</div>
      
    </li>
  
</ul>

</div>
        </dt>
        <dd><pre class="code"><span class='const'>Concurrent</span><span class='op'>::</span><span class='const'>Map</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span></pre></dd>
      
    </dl>
  




  <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#root_path-instance_method" title="#root_path (instance method)">#<strong>root_path</strong>  &#x21d2; Object </a>
    

    
  </span>
  
  
  
    
      <span class="note title readonly">readonly</span>
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Returns the value of attribute root_path.</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#scripts-instance_method" title="#scripts (instance method)">#<strong>scripts</strong>  &#x21d2; Object </a>
    

    
  </span>
  
  
  
    
      <span class="note title readonly">readonly</span>
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Returns the value of attribute scripts.</p>
</div></span>
  
</li>

    
  </ul>




  
    <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="#create-class_method" title="create (class method)">.<strong>create</strong>(root_path)  &#x21d2; Scripts </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Create a new scripts collection based on path.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#fetch-class_method" title="fetch (class method)">.<strong>fetch</strong>(root_path)  &#x21d2; Scripts </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Fetch a scripts configuration for path.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#store-class_method" title="store (class method)">.<strong>store</strong>(scripts)  &#x21d2; Scripts </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Store the scripts collection in memory.</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="#count-instance_method" title="#count (instance method)">#<strong>count</strong>  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong>(script)  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#execute-instance_method" title="#execute (instance method)">#<strong>execute</strong>(name, conn, keys: [], argv: [])  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Execute a lua script with given name.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#fetch-instance_method" title="#fetch (instance method)">#<strong>fetch</strong>(name, conn)  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(path)  &#x21d2; Scripts </a>
    

    
  </span>
  
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>A new instance of Scripts.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#kill-instance_method" title="#kill (instance method)">#<strong>kill</strong>(conn)  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#load-instance_method" title="#load (instance method)">#<strong>load</strong>(name, conn)  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
    </ul>
  

<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <h3 class="signature first" id="initialize-instance_method">
  
    #<strong>initialize</strong>(path)  &#x21d2; <tt><span class='object_link'><a href="" title="SidekiqUniqueJobs::RedisScript::Scripts (class)">Scripts</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Returns a new instance of Scripts.</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Raises:</p>
<ul class="raise">
  
    <li>
      
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


62
63
64
65
66
67</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis_script/scripts.rb', line 62</span>

<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>path needs to be a Pathname</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Pathname</span><span class='rparen'>)</span>

  <span class='ivar'>@scripts</span>   <span class='op'>=</span> <span class='const'>Concurrent</span><span class='op'>::</span><span class='const'>Map</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
  <span class='ivar'>@root_path</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id=""></span>
      <div class="method_details first">
  <h3 class="signature first" id="root_path-instance_method">
  
    #<strong>root_path</strong>  &#x21d2; <tt>Object</tt>  <span class="extras">(readonly)</span>
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Returns the value of attribute root_path.</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


60
61
62</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis_script/scripts.rb', line 60</span>

<span class='kw'>def</span> <span class='id identifier rubyid_root_path'>root_path</span>
  <span class='ivar'>@root_path</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id=""></span>
      <div class="method_details ">
  <h3 class="signature " id="scripts-instance_method">
  
    #<strong>scripts</strong>  &#x21d2; <tt>Object</tt>  <span class="extras">(readonly)</span>
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Returns the value of attribute scripts.</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


55
56
57</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis_script/scripts.rb', line 55</span>

<span class='kw'>def</span> <span class='id identifier rubyid_scripts'>scripts</span>
  <span class='ivar'>@scripts</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="create-class_method">
  
    .<strong>create</strong>(root_path)  &#x21d2; <tt><span class='object_link'><a href="" title="SidekiqUniqueJobs::RedisScript::Scripts (class)">Scripts</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Create a new scripts collection based on path</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>root_path</span>
      
      
        <span class='type'>(<tt>Pathname</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>the path to scripts</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="SidekiqUniqueJobs::RedisScript::Scripts (class)">Scripts</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>a collection of scripts</p>
</div>
      
    </li>
  
</ul>

</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/redis_script/scripts.rb', line 35</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_root_path'>root_path</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_scripts'>scripts</span> <span class='op'>=</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_root_path'>root_path</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span><span class='id identifier rubyid_scripts'>scripts</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="fetch-class_method">
  
    .<strong>fetch</strong>(root_path)  &#x21d2; <tt><span class='object_link'><a href="" title="SidekiqUniqueJobs::RedisScript::Scripts (class)">Scripts</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Fetch a scripts configuration for path</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>root_path</span>
      
      
        <span class='type'>(<tt>Pathname</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>the path to scripts</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="SidekiqUniqueJobs::RedisScript::Scripts (class)">Scripts</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>a collection of scripts</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


20
21
22
23
24
25
26</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis_script/scripts.rb', line 20</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_root_path'>root_path</span><span class='rparen'>)</span>
  <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_scripts'>scripts</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#SCRIPT_PATHS-constant" title="SidekiqUniqueJobs::RedisScript::Scripts::SCRIPT_PATHS (constant)">SCRIPT_PATHS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_root_path'>root_path</span><span class='rparen'>)</span><span class='rparen'>)</span>
    <span class='kw'>return</span> <span class='id identifier rubyid_scripts'>scripts</span>
  <span class='kw'>end</span>

  <span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_root_path'>root_path</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="store-class_method">
  
    .<strong>store</strong>(scripts)  &#x21d2; <tt><span class='object_link'><a href="" title="SidekiqUniqueJobs::RedisScript::Scripts (class)">Scripts</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Store the scripts collection in memory</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>scripts</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="SidekiqUniqueJobs::RedisScript::Scripts (class)">Scripts</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>the path to scripts</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="SidekiqUniqueJobs::RedisScript::Scripts (class)">Scripts</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>the scripts instance that was stored</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


47
48
49
50</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis_script/scripts.rb', line 47</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span><span class='id identifier rubyid_scripts'>scripts</span><span class='rparen'>)</span>
  <span class='const'><span class='object_link'><a href="#SCRIPT_PATHS-constant" title="SidekiqUniqueJobs::RedisScript::Scripts::SCRIPT_PATHS (constant)">SCRIPT_PATHS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='id identifier rubyid_scripts'>scripts</span><span class='period'>.</span><span class='id identifier rubyid_root_path'>root_path</span><span class='comma'>,</span> <span class='id identifier rubyid_scripts'>scripts</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_scripts'>scripts</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="count-instance_method">
  
    #<strong>count</strong>  &#x21d2; <tt>Object</tt> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


118
119
120</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis_script/scripts.rb', line 118</span>

<span class='kw'>def</span> <span class='id identifier rubyid_count'>count</span>
  <span class='id identifier rubyid_scripts'>scripts</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="delete-instance_method">
  
    #<strong>delete</strong>(script)  &#x21d2; <tt>Object</tt> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


84
85
86
87
88
89
90</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis_script/scripts.rb', line 84</span>

<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_script'>script</span><span class='rparen'>)</span>
  <span class='kw'>if</span> <span class='id identifier rubyid_script'>script</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="Script.html" title="SidekiqUniqueJobs::RedisScript::Script (class)">Script</a></span></span><span class='rparen'>)</span>
    <span class='id identifier rubyid_scripts'>scripts</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_script'>script</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
  <span class='kw'>else</span>
    <span class='id identifier rubyid_scripts'>scripts</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_script'>script</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</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="execute-instance_method">
  
    #<strong>execute</strong>(name, conn, keys: [], argv: [])  &#x21d2; <tt>Object</tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
  <div class="note notetag">
    <strong>Note:</strong>
    <div class='inline'><p>this method is recursive if we need to load a lua script
that wasn&#39;t previously loaded.</p>
</div>
  </div>

<p>Execute a lua script with given name</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>name</span>
      
      
        <span class='type'>(<tt>Symbol</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>the name of the script to execute</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>conn</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="../Redis.html" title="SidekiqUniqueJobs::Redis (module)">Redis</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>the redis connection to use for execution</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>keys</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="../../Array.html" title="Array (class)">Array</a></span>&lt;String&gt;</tt>)</span>
      
      
        <em class="default">(defaults to: <tt>[]</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>script keys</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>argv</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="../../Array.html" title="Array (class)">Array</a></span>&lt;Object&gt;</tt>)</span>
      
      
        <em class="default">(defaults to: <tt>[]</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>script arguments</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'></span>
      
      
      
        
        <div class='inline'><p>value from script</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


113
114
115
116</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis_script/scripts.rb', line 113</span>

<span class='kw'>def</span> <span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_conn'>conn</span><span class='comma'>,</span> <span class='label'>keys:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>argv:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_script'>script</span> <span class='op'>=</span> <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_conn'>conn</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_conn'>conn</span><span class='period'>.</span><span class='id identifier rubyid_evalsha'>evalsha</span><span class='lparen'>(</span><span class='id identifier rubyid_script'>script</span><span class='period'>.</span><span class='id identifier rubyid_sha'>sha</span><span class='comma'>,</span> <span class='id identifier rubyid_keys'>keys</span><span class='comma'>,</span> <span class='id identifier rubyid_argv'>argv</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="fetch-instance_method">
  
    #<strong>fetch</strong>(name, conn)  &#x21d2; <tt>Object</tt> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


69
70
71
72
73
74
75</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis_script/scripts.rb', line 69</span>

<span class='kw'>def</span> <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_conn'>conn</span><span class='rparen'>)</span>
  <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_script'>script</span> <span class='op'>=</span> <span class='id identifier rubyid_scripts'>scripts</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rparen'>)</span><span class='rparen'>)</span>
    <span class='kw'>return</span> <span class='id identifier rubyid_script'>script</span>
  <span class='kw'>end</span>

  <span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_conn'>conn</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="kill-instance_method">
  
    #<strong>kill</strong>(conn)  &#x21d2; <tt>Object</tt> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


92
93
94
95
96
97
98</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis_script/scripts.rb', line 92</span>

<span class='kw'>def</span> <span class='id identifier rubyid_kill'>kill</span><span class='lparen'>(</span><span class='id identifier rubyid_conn'>conn</span><span class='rparen'>)</span>
  <span class='kw'>if</span> <span class='id identifier rubyid_conn'>conn</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:namespace</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_conn'>conn</span><span class='period'>.</span><span class='id identifier rubyid_redis'>redis</span><span class='period'>.</span><span class='id identifier rubyid_script'>script</span><span class='lparen'>(</span><span class='symbol'>:kill</span><span class='rparen'>)</span>
  <span class='kw'>else</span>
    <span class='id identifier rubyid_conn'>conn</span><span class='period'>.</span><span class='id identifier rubyid_script'>script</span><span class='lparen'>(</span><span class='symbol'>:kill</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="load-instance_method">
  
    #<strong>load</strong>(name, conn)  &#x21d2; <tt>Object</tt> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


77
78
79
80
81
82</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/redis_script/scripts.rb', line 77</span>

<span class='kw'>def</span> <span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_conn'>conn</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_script'>script</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Script.html" title="SidekiqUniqueJobs::RedisScript::Script (class)">Script</a></span></span><span class='period'>.</span><span class='id identifier rubyid_load'><span class='object_link'><a href="Script.html#load-class_method" title="SidekiqUniqueJobs::RedisScript::Script.load (method)">load</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_root_path'>root_path</span><span class='comma'>,</span> <span class='id identifier rubyid_conn'>conn</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_scripts'>scripts</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='comma'>,</span> <span class='id identifier rubyid_script'>script</span><span class='rparen'>)</span>

  <span class='id identifier rubyid_script'>script</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

      <div id="footer">
  Generated on Wed Jan 24 10:57:26 2024 by
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.9.34 (ruby-3.3.0).
</div>

    </div>
  </body>
</html>