rdoc/Resque/JobWithStatus.html in resque_ui-3.2.3 vs rdoc/Resque/JobWithStatus.html in resque_ui-3.2.4

- old
+ new

@@ -1,474 +1,441 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<!DOCTYPE html> + +<html> <head> - <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> +<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> - <title>Class: Resque::JobWithStatus</title> +<title>Class: Resque::JobWithStatus</title> - <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" /> +<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet"> - <script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script> - <script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script> - <script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script> - <script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script> +<script type="text/javascript"> + var rdoc_rel_prefix = "../"; +</script> -</head> +<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script> +<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script> +<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script> +<script type="text/javascript" charset="utf-8" src="../js/search.js"></script> +<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script> +<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script> + + <body id="top" class="class"> +<nav id="metadata"> + <nav id="home-section" class="section"> + <h3 class="section-header"> + <a href="../index.html">Home</a> + <a href="../table_of_contents.html#classes">Classes</a> + <a href="../table_of_contents.html#methods">Methods</a> + </h3> +</nav> - <div id="metadata"> - <div id="home-metadata"> - <div id="home-section" class="section"> - <h3 class="section-header"> - <a href="../index.html">Home</a> - <a href="../index.html#classes">Classes</a> - <a href="../index.html#methods">Methods</a> - </h3> - </div> - </div> - <div id="file-metadata"> - <div id="file-list-section" class="section"> - <h3 class="section-header">In Files</h3> - <div class="section-body"> - <ul> - - <li><a href="../lib/resque_ui/overrides/resque_status/job_with_status_rb.html?TB_iframe=true&amp;height=550&amp;width=785" - class="thickbox" title="lib/resque_ui/overrides/resque_status/job_with_status.rb">lib/resque_ui/overrides/resque_status/job_with_status.rb</a></li> - - </ul> - </div> - </div> + <nav id="search-section" class="section project-section" class="initially-hidden"> + <form action="#" method="get" accept-charset="utf-8"> + <h3 class="section-header"> + <input type="text" name="search" placeholder="Search" id="search-field" + title="Type to search, Up and Down to navigate, Enter to load"> + </h3> + </form> - - </div> + <ul id="search-results" class="initially-hidden"></ul> +</nav> - <div id="class-metadata"> - - <!-- Parent Class --> - <div id="parent-class-section" class="section"> - <h3 class="section-header">Parent</h3> - - <p class="link"><a href="../Object.html">Object</a></p> - - </div> - - + <div id="file-metadata"> + <nav id="file-list-section" class="section"> + <h3 class="section-header">Defined In</h3> + <ul> + <li>lib/resque_ui/overrides/resque_status/job_with_status.rb + </ul> +</nav> - + + </div> - - <!-- Method Quickref --> - <div id="method-list-section" class="section"> - <h3 class="section-header">Methods</h3> - <ul class="link-list"> - - <li><a href="#method-c-enqueue">::enqueue</a></li> - - <li><a href="#method-c-new">::new</a></li> - - <li><a href="#method-c-perform">::perform</a></li> - - <li><a href="#method-i-counter">#counter</a></li> - - <li><a href="#method-i-incr_counter">#incr_counter</a></li> - - <li><a href="#method-i-name">#name</a></li> - - <li><a href="#method-i-pause-21">#pause!</a></li> - - <li><a href="#method-i-safe_perform-21">#safe_perform!</a></li> - - <li><a href="#method-i-tick">#tick</a></li> - - </ul> - </div> - + <div id="class-metadata"> + + <nav id="parent-class-section" class="section"> + <h3 class="section-header">Parent</h3> + + <p class="link"><a href="../Object.html">Object</a> + +</nav> - - </div> + + <!-- Method Quickref --> +<nav id="method-list-section" class="section"> + <h3 class="section-header">Methods</h3> - <div id="project-metadata"> - - + <ul class="link-list"> + + <li><a href="#method-c-enqueue">::enqueue</a> + + <li><a href="#method-c-new">::new</a> + + <li><a href="#method-c-perform">::perform</a> + + <li><a href="#method-i-counter">#counter</a> + + <li><a href="#method-i-incr_counter">#incr_counter</a> + + <li><a href="#method-i-name">#name</a> + + <li><a href="#method-i-pause-21">#pause!</a> + + <li><a href="#method-i-safe_perform-21">#safe_perform!</a> + + <li><a href="#method-i-tick">#tick</a> + + </ul> +</nav> - <div id="classindex-section" class="section project-section"> - <h3 class="section-header">Class/Module Index - <span class="search-toggle"><img src="../images/find.png" - height="16" width="16" alt="[+]" - title="show/hide quicksearch" /></span></h3> - <form action="#" method="get" accept-charset="utf-8" class="initially-hidden"> - <fieldset> - <legend>Quicksearch</legend> - <input type="text" name="quicksearch" value="" - class="quicksearch-field" /> - </fieldset> - </form> + </div> - <ul class="link-list"> - - <li><a href="../Resque.html">Resque</a></li> - - <li><a href="../Resque/ChainedJobWithStatus.html">Resque::ChainedJobWithStatus</a></li> - - <li><a href="../Resque/Job.html">Resque::Job</a></li> - - <li><a href="../Resque/JobWithStatus.html">Resque::JobWithStatus</a></li> - - <li><a href="../Resque/Status.html">Resque::Status</a></li> - - <li><a href="../Resque/Worker.html">Resque::Worker</a></li> - - <li><a href="../ResqueUi.html">ResqueUi</a></li> - - <li><a href="../ResqueUi/Cap.html">ResqueUi::Cap</a></li> - - <li><a href="../ResqueUi/Engine.html">ResqueUi::Engine</a></li> - - <li><a href="../Object.html">Object</a></li> - - <li><a href="../ResqueScheduler.html">ResqueScheduler</a></li> - - </ul> - <div id="no-class-search-results" style="display: none;">No matching classes.</div> - </div> + <div id="project-metadata"> + + <nav id="classindex-section" class="section project-section"> + <h3 class="section-header">Class and Module Index</h3> - - </div> + <ul class="link-list"> + + <li><a href="../Resque.html">Resque</a> + + <li><a href="../Resque/ChainedJobWithStatus.html">Resque::ChainedJobWithStatus</a> + + <li><a href="../Resque/Failure.html">Resque::Failure</a> + + <li><a href="../Resque/Failure/Redis.html">Resque::Failure::Redis</a> + + <li><a href="../Resque/Job.html">Resque::Job</a> + + <li><a href="../Resque/JobWithStatus.html">Resque::JobWithStatus</a> + + <li><a href="../Resque/Status.html">Resque::Status</a> + + <li><a href="../Resque/Worker.html">Resque::Worker</a> + + <li><a href="../ResqueUi.html">ResqueUi</a> + + <li><a href="../ResqueUi/Cap.html">ResqueUi::Cap</a> + + <li><a href="../ResqueUi/Engine.html">ResqueUi::Engine</a> + + <li><a href="../Object.html">Object</a> + + <li><a href="../ResqueScheduler.html">ResqueScheduler</a> + + </ul> +</nav> + </div> +</nav> - <div id="documentation"> - <h1 class="class">Resque::JobWithStatus</h1> +<div id="documentation"> + <h1 class="class">class Resque::JobWithStatus</h1> - <div id="description" class="description"> - - </div><!-- description --> + <div id="description" class="description"> + + </div><!-- description --> + + + + <section id="5Buntitled-5D" class="documentation-section"> + + - <div id="5Buntitled-5D" class="documentation-section"> - - + + <!-- Attributes --> + <section id="attribute-method-details" class="method-section section"> + <h3 class="section-header">Attributes</h3> + <div id="attribute-i-worker" class="method-detail"> + <div class="method-heading attribute-method-heading"> + <span class="method-name">worker</span><span + class="attribute-access-type">[R]</span> + </div> + <div class="method-description"> + + + + </div> + </div> - <!-- Attributes --> - <div id="attribute-method-details" class="method-section section"> - <h3 class="section-header">Attributes</h3> + </section><!-- attribute-method-details --> + - - <div id="worker-attribute-method" class="method-detail"> - <a name="worker"></a> - - <div class="method-heading attribute-method-heading"> - <span class="method-name">worker</span><span - class="attribute-access-type">[R]</span> - </div> + <!-- Methods --> + + <section id="public-class-5Buntitled-5D-method-details" class="method-section section"> + <h3 class="section-header">Public Class Methods</h3> - <div class="method-description"> - - - - </div> + + <div id="method-c-enqueue" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">enqueue</span><span + class="method-args">(klass, options = {})</span> + <span class="method-click-advice">click to toggle source</span> </div> - </div><!-- attribute-method-details --> - - <!-- Methods --> - - <div id="public-class-method-details" class="method-section section"> - <h3 class="section-header">Public Class Methods</h3> - - - <div id="enqueue-method" class="method-detail "> - <a name="method-c-enqueue"></a> - + <div class="method-description"> - <div class="method-heading"> - <span class="method-name">enqueue</span><span - class="method-args">(klass, options = {})</span> - <span class="method-click-advice">click to toggle source</span> - </div> - - - <div class="method-description"> - - <p>Adds a job of type &lt;tt&gt;klass&lt;tt&gt; to the queue with + <p>Adds a job of type &lt;tt&gt;klass&lt;tt&gt; to the queue with &lt;tt&gt;options&lt;tt&gt;. Returns the UUID of the job override to pass actual parameters instead of a single hash, to make backward compatible with existing resque jobs.</p> - + - - <div class="method-source-code" id="enqueue-source"> -<pre> -<span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 9</span> + + <div class="method-source-code" id="enqueue-source"> + <pre><span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 9</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">enqueue</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-identifier">options</span> = {}) <span class="ruby-identifier">uuid</span> = <span class="ruby-constant">Resque</span><span class="ruby-operator">::</span><span class="ruby-constant">Status</span>.<span class="ruby-identifier">create</span> <span class="ruby-value">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{self.name}: #{options.inspect}&quot;</span> <span class="ruby-constant">Resque</span>.<span class="ruby-identifier">enqueue</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-identifier">uuid</span>, <span class="ruby-identifier">options</span>) <span class="ruby-identifier">uuid</span> <span class="ruby-keyword">end</span></pre> - </div><!-- enqueue-source --> - - </div> - + </div><!-- enqueue-source --> + </div> - - </div><!-- enqueue-method --> + - - <div id="new-method" class="method-detail "> - <a name="method-c-new"></a> + + </div><!-- enqueue-method --> + + <div id="method-c-new" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">new</span><span + class="method-args">(uuid, worker = nil, options = {})</span> + <span class="method-click-advice">click to toggle source</span> + </div> + + + <div class="method-description"> - <div class="method-heading"> - <span class="method-name">new</span><span - class="method-args">(uuid, worker = nil, options = {})</span> - <span class="method-click-advice">click to toggle source</span> - </div> + <p>Create a new instance with <code>uuid</code> and <code>options</code> +OVERRIDE to add the worker attr</p> - <div class="method-description"> - - <p>Create a new instance with <tt>uuid</tt> and <tt>options</tt> OVERRIDE to -add the worker attr</p> - - - - <div class="method-source-code" id="new-source"> -<pre> -<span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 45</span> + + <div class="method-source-code" id="new-source"> + <pre><span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 45</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">uuid</span>, <span class="ruby-identifier">worker</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">options</span> = {}) <span class="ruby-ivar">@uuid</span> = <span class="ruby-identifier">uuid</span> <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span> <span class="ruby-ivar">@worker</span> = <span class="ruby-identifier">worker</span> <span class="ruby-keyword">end</span></pre> - </div><!-- new-source --> - - </div> - + </div><!-- new-source --> + </div> - - </div><!-- new-method --> + - - <div id="perform-method" class="method-detail "> - <a name="method-c-perform"></a> + + </div><!-- new-method --> - - <div class="method-heading"> - <span class="method-name">perform</span><span - class="method-args">(uuid=nil, options = {})</span> - <span class="method-click-advice">click to toggle source</span> - </div> - + + <div id="method-c-perform" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">perform</span><span + class="method-args">(uuid=nil, options = {}) { || ... }</span> + <span class="method-click-advice">click to toggle source</span> + </div> + - <div class="method-description"> - - <p>This is the method called by <a href="Worker.html">Resque::Worker</a> when + <div class="method-description"> + + <p>This is the method called by <a href="Worker.html">Resque::Worker</a> when processing jobs. It creates a new instance of the job class and populates it with the uuid and options.</p> -<p>You should not override this method, rather the <tt>perform</tt> instance -method. OVERRIDE to pass the block in order to set the worker status, -returns the worker object</p> - +<p>You should not override this method, rather the <code>perform</code> +instance method. OVERRIDE to pass the block in order to set the worker +status, returns the worker object</p> + - - <div class="method-source-code" id="perform-source"> -<pre> -<span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 57</span> + + <div class="method-source-code" id="perform-source"> + <pre><span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 57</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">perform</span>(<span class="ruby-identifier">uuid</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">options</span> = {}) <span class="ruby-identifier">uuid</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Resque</span><span class="ruby-operator">::</span><span class="ruby-constant">Status</span>.<span class="ruby-identifier">generate_uuid</span> <span class="ruby-identifier">worker</span> = <span class="ruby-keyword">yield</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span> <span class="ruby-identifier">instance</span> = <span class="ruby-identifier">new</span>(<span class="ruby-identifier">uuid</span>, <span class="ruby-identifier">worker</span>, <span class="ruby-identifier">options</span>) <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">safe_perform!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">status</span><span class="ruby-operator">|</span> <span class="ruby-keyword">yield</span> <span class="ruby-identifier">status</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span> } <span class="ruby-identifier">instance</span> <span class="ruby-keyword">end</span></pre> - </div><!-- perform-source --> - - </div> - + </div><!-- perform-source --> + </div> - - </div><!-- perform-method --> + - - </div><!-- public-class-method-details --> + + </div><!-- perform-method --> + - <div id="public-instance-method-details" class="method-section section"> - <h3 class="section-header">Public Instance Methods</h3> + </section><!-- public-class-method-details --> + + <section id="public-instance-5Buntitled-5D-method-details" class="method-section section"> + <h3 class="section-header">Public Instance Methods</h3> - - <div id="counter-method" class="method-detail "> - <a name="method-i-counter"></a> + + <div id="method-i-counter" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">counter</span><span + class="method-args">(counter)</span> + <span class="method-click-advice">click to toggle source</span> + </div> + + <div class="method-description"> - <div class="method-heading"> - <span class="method-name">counter</span><span - class="method-args">(counter)</span> - <span class="method-click-advice">click to toggle source</span> - </div> + - <div class="method-description"> - - - - - - <div class="method-source-code" id="counter-source"> -<pre> -<span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 99</span> + + <div class="method-source-code" id="counter-source"> + <pre><span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 99</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">counter</span>(<span class="ruby-identifier">counter</span>) <span class="ruby-constant">Resque</span><span class="ruby-operator">::</span><span class="ruby-constant">Status</span>.<span class="ruby-identifier">counter</span>(<span class="ruby-identifier">counter</span>, <span class="ruby-identifier">uuid</span>) <span class="ruby-keyword">end</span></pre> - </div><!-- counter-source --> - - </div> - + </div><!-- counter-source --> + </div> - - </div><!-- counter-method --> + - - <div id="incr_counter-method" class="method-detail "> - <a name="method-i-incr_counter"></a> + + </div><!-- counter-method --> + + <div id="method-i-incr_counter" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">incr_counter</span><span + class="method-args">(counter)</span> + <span class="method-click-advice">click to toggle source</span> + </div> + + + <div class="method-description"> - <div class="method-heading"> - <span class="method-name">incr_counter</span><span - class="method-args">(counter)</span> - <span class="method-click-advice">click to toggle source</span> - </div> + - <div class="method-description"> - - - - - - <div class="method-source-code" id="incr_counter-source"> -<pre> -<span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 95</span> + + <div class="method-source-code" id="incr_counter-source"> + <pre><span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 95</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">incr_counter</span>(<span class="ruby-identifier">counter</span>) <span class="ruby-constant">Resque</span><span class="ruby-operator">::</span><span class="ruby-constant">Status</span>.<span class="ruby-identifier">incr_counter</span>(<span class="ruby-identifier">counter</span>, <span class="ruby-identifier">uuid</span>) <span class="ruby-keyword">end</span></pre> - </div><!-- incr_counter-source --> - - </div> - + </div><!-- incr_counter-source --> + </div> - - </div><!-- incr_counter-method --> + - - <div id="name-method" class="method-detail "> - <a name="method-i-name"></a> + + </div><!-- incr_counter-method --> + + <div id="method-i-name" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">name</span><span + class="method-args">()</span> + <span class="method-click-advice">click to toggle source</span> + </div> + + + <div class="method-description"> - <div class="method-heading"> - <span class="method-name">name</span><span - class="method-args">()</span> - <span class="method-click-advice">click to toggle source</span> - </div> + - <div class="method-description"> - - - - - - <div class="method-source-code" id="name-source"> -<pre> -<span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 91</span> + + <div class="method-source-code" id="name-source"> + <pre><span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 91</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">name</span> <span class="ruby-node">&quot;#{self.class.name}: #{options.inspect}&quot;</span> <span class="ruby-keyword">end</span></pre> - </div><!-- name-source --> - - </div> - + </div><!-- name-source --> + </div> - - </div><!-- name-method --> + - - <div id="pause-21-method" class="method-detail "> - <a name="method-i-pause-21"></a> + + </div><!-- name-method --> + + <div id="method-i-pause-21" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">pause!</span><span + class="method-args">()</span> + <span class="method-click-advice">click to toggle source</span> + </div> + + + <div class="method-description"> - <div class="method-heading"> - <span class="method-name">pause!</span><span - class="method-args">()</span> - <span class="method-click-advice">click to toggle source</span> - </div> + <p>Pause the current job, setting the status to ‘paused’</p> - <div class="method-description"> - - <p>Pause the current job, setting the status to ‘paused’</p> - - - - <div class="method-source-code" id="pause-21-source"> -<pre> -<span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 36</span> + + <div class="method-source-code" id="pause-21-source"> + <pre><span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 36</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">pause!</span> <span class="ruby-identifier">set_status</span>({ <span class="ruby-string">'status'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'paused'</span>, <span class="ruby-string">'message'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{worker} paused at #{Time.now}&quot;</span> }) <span class="ruby-keyword">end</span></pre> - </div><!-- pause-21-source --> - - </div> - + </div><!-- pause-21-source --> + </div> - - </div><!-- pause-21-method --> + - - <div id="safe_perform-21-method" class="method-detail "> - <a name="method-i-safe_perform-21"></a> + + </div><!-- pause-21-method --> + + <div id="method-i-safe_perform-21" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">safe_perform!</span><span + class="method-args">() { |status| ... }</span> + <span class="method-click-advice">click to toggle source</span> + </div> + + + <div class="method-description"> - <div class="method-heading"> - <span class="method-name">safe_perform!</span><span - class="method-args">()</span> - <span class="method-click-advice">click to toggle source</span> - </div> + <p>Run by the <a href="Worker.html">Resque::Worker</a> when processing this +job. It wraps the <code>perform</code> method ensuring that the final +status of the job is set regardless of error. If an error occurs within the +job’s work, it will set the status as failed and re-raise the error.</p> - <div class="method-description"> - - <p>Run by the <a href="Worker.html">Resque::Worker</a> when processing this -job. It wraps the <tt>perform</tt> method ensuring that the final status of -the job is set regardless of error. If an error occurs within the job’s -work, it will set the status as failed and re-raise the error.</p> - - - - <div class="method-source-code" id="safe_perform-21-source"> -<pre> -<span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 69</span> + + <div class="method-source-code" id="safe_perform-21-source"> + <pre><span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 69</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">safe_perform!</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">should_kill?</span> <span class="ruby-operator">||</span> (<span class="ruby-identifier">status</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">status</span>.<span class="ruby-identifier">killed?</span>) <span class="ruby-identifier">set_status</span>({<span class="ruby-string">'status'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'working'</span>}) <span class="ruby-identifier">perform</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">status</span><span class="ruby-operator">|</span> <span class="ruby-keyword">yield</span> <span class="ruby-identifier">status</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span> } <span class="ruby-identifier">kill!</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">should_kill?</span> @@ -486,43 +453,40 @@ <span class="ruby-identifier">on_failure</span>(<span class="ruby-identifier">e</span>) <span class="ruby-keyword">else</span> <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span></pre> - </div><!-- safe_perform-21-source --> - - </div> - + </div><!-- safe_perform-21-source --> + </div> - - </div><!-- safe_perform-21-method --> + - - <div id="tick-method" class="method-detail "> - <a name="method-i-tick"></a> + + </div><!-- safe_perform-21-method --> + + <div id="method-i-tick" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">tick</span><span + class="method-args">(*messages)</span> + <span class="method-click-advice">click to toggle source</span> + </div> + + + <div class="method-description"> - <div class="method-heading"> - <span class="method-name">tick</span><span - class="method-args">(*messages)</span> - <span class="method-click-advice">click to toggle source</span> - </div> + <p>sets the status of the job for the current iteration. You should use the +<code>at</code> method if you have actual numbers to track the iteration +count. This will kill the job if it has been added to the kill list with +<code>Resque::Status.kill()</code></p> - <div class="method-description"> - - <p>sets the status of the job for the current iteration. You should use the -<tt>at</tt> method if you have actual numbers to track the iteration count. -This will kill the job if it has been added to the kill list with -<tt>Resque::Status.kill()</tt></p> - - - - <div class="method-source-code" id="tick-source"> -<pre> -<span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 19</span> + + <div class="method-source-code" id="tick-source"> + <pre><span class="ruby-comment"># File lib/resque_ui/overrides/resque_status/job_with_status.rb, line 19</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">tick</span>(*<span class="ruby-identifier">messages</span>) <span class="ruby-identifier">kill!</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">should_kill?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">status</span>.<span class="ruby-identifier">killed?</span> <span class="ruby-identifier">set_status</span>({<span class="ruby-string">'status'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'working'</span>}, *<span class="ruby-identifier">messages</span>) <span class="ruby-comment"># check to see if the worker doing the job has been paused, pause the job if so</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">worker</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">worker</span>.<span class="ruby-identifier">paused?</span> @@ -534,31 +498,28 @@ <span class="ruby-identifier">sleep</span> <span class="ruby-value">60</span> <span class="ruby-keyword">end</span> <span class="ruby-identifier">set_status</span>({<span class="ruby-string">'status'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'working'</span>}, *<span class="ruby-identifier">messages</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">status</span>.<span class="ruby-identifier">completed?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">status</span>.<span class="ruby-identifier">paused?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">status</span>.<span class="ruby-identifier">killed?</span>) <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span></pre> - </div><!-- tick-source --> - - </div> - + </div><!-- tick-source --> + </div> - - </div><!-- tick-method --> + - - </div><!-- public-instance-method-details --> + + </div><!-- tick-method --> + - </div><!-- 5Buntitled-5D --> + </section><!-- public-instance-method-details --> + </section><!-- 5Buntitled-5D --> - </div><!-- documentation --> +</div><!-- documentation --> - <div id="validator-badges"> - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> - <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish - Rdoc Generator</a> 2</small>.</p> - </div> -</body> -</html> +<footer id="validator-badges"> + <p><a href="http://validator.w3.org/check/referer">[Validate]</a> + <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.11. + <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3. +</footer>