resque_ui 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +6 -0
- data/Gemfile.lock +102 -0
- data/History.txt +5 -0
- data/MIT-LICENSE +21 -0
- data/README.markdown +279 -0
- data/Rakefile +49 -0
- data/VERSION.yml +5 -0
- data/app/assets/images/idle.png +0 -0
- data/app/assets/images/poll.png +0 -0
- data/app/assets/images/working.png +0 -0
- data/app/assets/javascripts/resque/jquery-1.3.2.min.js +19 -0
- data/app/assets/javascripts/resque/jquery.relatize_date.js +95 -0
- data/app/assets/javascripts/resque/ranger.js +24 -0
- data/app/assets/stylesheets/resque/resque.css +93 -0
- data/app/assets/stylesheets/resque/resque_reset.css +48 -0
- data/app/controllers/resque_controller.rb +236 -0
- data/app/helpers/resque_helper.rb +107 -0
- data/app/views/layouts/resque.html.erb +39 -0
- data/app/views/resque/_key.html.erb +17 -0
- data/app/views/resque/_next_more.html.erb +10 -0
- data/app/views/resque/_queues.html.erb +52 -0
- data/app/views/resque/_status_styles.erb +98 -0
- data/app/views/resque/_workers.html.erb +110 -0
- data/app/views/resque/_working.html.erb +69 -0
- data/app/views/resque/delayed.html.erb +35 -0
- data/app/views/resque/delayed_timestamp.html.erb +26 -0
- data/app/views/resque/error.erb +1 -0
- data/app/views/resque/failed.html.erb +54 -0
- data/app/views/resque/overview.html.erb +4 -0
- data/app/views/resque/schedule.html.erb +96 -0
- data/app/views/resque/stats.html.erb +62 -0
- data/app/views/resque/status.html.erb +57 -0
- data/app/views/resque/statuses.html.erb +72 -0
- data/app/views/resque/workers.html.erb +1 -0
- data/lib/resque_ui/cap.rb +6 -0
- data/lib/resque_ui/cap_recipes.rb +106 -0
- data/lib/resque_ui/overrides/resque/failure/failure.rb +22 -0
- data/lib/resque_ui/overrides/resque/job.rb +12 -0
- data/lib/resque_ui/overrides/resque/resque.rb +8 -0
- data/lib/resque_ui/overrides/resque/worker.rb +230 -0
- data/lib/resque_ui/overrides/resque_scheduler/resque_scheduler.rb +58 -0
- data/lib/resque_ui/overrides/resque_status/chained_job_with_status.rb +24 -0
- data/lib/resque_ui/overrides/resque_status/job_with_status.rb +59 -0
- data/lib/resque_ui/overrides/resque_status/status.rb +53 -0
- data/lib/resque_ui.rb +26 -0
- data/lib/tasks/failure.rake +8 -0
- data/lib/tasks/scheduler.rake +11 -0
- data/lib/tasks/worker.rake +80 -0
- data/rdoc/Resque/ChainedJobWithStatus.html +284 -0
- data/rdoc/Resque/Failure/Base.html +229 -0
- data/rdoc/Resque/Failure.html +202 -0
- data/rdoc/Resque/Job.html +202 -0
- data/rdoc/Resque/JobWithStatus.html +410 -0
- data/rdoc/Resque/Status.html +368 -0
- data/rdoc/Resque/Worker.html +1104 -0
- data/rdoc/Resque.html +232 -0
- data/rdoc/ResqueScheduler.html +434 -0
- data/rdoc/ResqueUi/Cap.html +150 -0
- data/rdoc/ResqueUi/Engine.html +150 -0
- data/rdoc/ResqueUi.html +157 -0
- data/rdoc/created.rid +13 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +163 -0
- data/rdoc/js/darkfish.js +116 -0
- data/rdoc/js/jquery.js +32 -0
- data/rdoc/js/quicksearch.js +114 -0
- data/rdoc/js/thickbox-compressed.js +10 -0
- data/rdoc/lib/resque_overrides_rb.html +54 -0
- data/rdoc/lib/resque_scheduler_overrides_rb.html +52 -0
- data/rdoc/lib/resque_status_overrides_rb.html +52 -0
- data/rdoc/lib/resque_ui/cap_rb.html +52 -0
- data/rdoc/lib/resque_ui/cap_recipes_rb.html +58 -0
- data/rdoc/lib/resque_ui/engine_rb.html +52 -0
- data/rdoc/lib/resque_ui/overrides/resque/failure/failure_rb.html +54 -0
- data/rdoc/lib/resque_ui/overrides/resque/job_rb.html +52 -0
- data/rdoc/lib/resque_ui/overrides/resque/resque_rb.html +52 -0
- data/rdoc/lib/resque_ui/overrides/resque/worker_rb.html +54 -0
- data/rdoc/lib/resque_ui/overrides/resque_scheduler/resque_scheduler_rb.html +52 -0
- data/rdoc/lib/resque_ui/overrides/resque_status/chained_job_with_status_rb.html +52 -0
- data/rdoc/lib/resque_ui/overrides/resque_status/job_with_status_rb.html +52 -0
- data/rdoc/lib/resque_ui/overrides/resque_status/status_rb.html +52 -0
- data/rdoc/lib/resque_ui/resque_ui_rb.html +52 -0
- data/rdoc/lib/resque_ui/tasks_rb.html +64 -0
- data/rdoc/lib/resque_ui_rb.html +76 -0
- data/rdoc/rdoc.css +763 -0
- data/resque_ui.gemspec +153 -0
- data/test/resque_ui_test.rb +8 -0
- data/test/test_helper.rb +3 -0
- metadata +205 -0
data/rdoc/Resque.html
ADDED
@@ -0,0 +1,232 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Module: Resque</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
<script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body id="top" class="module">
|
19
|
+
|
20
|
+
<div id="metadata">
|
21
|
+
<div id="home-metadata">
|
22
|
+
<div id="home-section" class="section">
|
23
|
+
<h3 class="section-header">
|
24
|
+
<a href="./index.html">Home</a>
|
25
|
+
<a href="./index.html#classes">Classes</a>
|
26
|
+
<a href="./index.html#methods">Methods</a>
|
27
|
+
</h3>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div id="file-metadata">
|
32
|
+
<div id="file-list-section" class="section">
|
33
|
+
<h3 class="section-header">In Files</h3>
|
34
|
+
<div class="section-body">
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li><a href="./lib/resque_ui/overrides/resque/job_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="lib/resque_ui/overrides/resque/job.rb">lib/resque_ui/overrides/resque/job.rb</a></li>
|
39
|
+
|
40
|
+
<li><a href="./lib/resque_ui/overrides/resque/resque_rb.html?TB_iframe=true&height=550&width=785"
|
41
|
+
class="thickbox" title="lib/resque_ui/overrides/resque/resque.rb">lib/resque_ui/overrides/resque/resque.rb</a></li>
|
42
|
+
|
43
|
+
<li><a href="./lib/resque_ui/overrides/resque/worker_rb.html?TB_iframe=true&height=550&width=785"
|
44
|
+
class="thickbox" title="lib/resque_ui/overrides/resque/worker.rb">lib/resque_ui/overrides/resque/worker.rb</a></li>
|
45
|
+
|
46
|
+
<li><a href="./lib/resque_ui/overrides/resque/failure/failure_rb.html?TB_iframe=true&height=550&width=785"
|
47
|
+
class="thickbox" title="lib/resque_ui/overrides/resque/failure/failure.rb">lib/resque_ui/overrides/resque/failure/failure.rb</a></li>
|
48
|
+
|
49
|
+
<li><a href="./lib/resque_ui/overrides/resque_status/chained_job_with_status_rb.html?TB_iframe=true&height=550&width=785"
|
50
|
+
class="thickbox" title="lib/resque_ui/overrides/resque_status/chained_job_with_status.rb">lib/resque_ui/overrides/resque_status/chained_job_with_status.rb</a></li>
|
51
|
+
|
52
|
+
<li><a href="./lib/resque_ui/overrides/resque_status/job_with_status_rb.html?TB_iframe=true&height=550&width=785"
|
53
|
+
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>
|
54
|
+
|
55
|
+
<li><a href="./lib/resque_ui/overrides/resque_status/status_rb.html?TB_iframe=true&height=550&width=785"
|
56
|
+
class="thickbox" title="lib/resque_ui/overrides/resque_status/status.rb">lib/resque_ui/overrides/resque_status/status.rb</a></li>
|
57
|
+
|
58
|
+
</ul>
|
59
|
+
</div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<div id="class-metadata">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
<!-- Namespace Contents -->
|
72
|
+
<div id="namespace-list-section" class="section">
|
73
|
+
<h3 class="section-header">Namespace</h3>
|
74
|
+
<ul class="link-list">
|
75
|
+
|
76
|
+
<li><span class="type">MODULE</span> <a href="Resque/Failure.html">Resque::Failure</a></li>
|
77
|
+
|
78
|
+
<li><span class="type">CLASS</span> <a href="Resque/ChainedJobWithStatus.html">Resque::ChainedJobWithStatus</a></li>
|
79
|
+
|
80
|
+
<li><span class="type">CLASS</span> <a href="Resque/Job.html">Resque::Job</a></li>
|
81
|
+
|
82
|
+
<li><span class="type">CLASS</span> <a href="Resque/JobWithStatus.html">Resque::JobWithStatus</a></li>
|
83
|
+
|
84
|
+
<li><span class="type">CLASS</span> <a href="Resque/Status.html">Resque::Status</a></li>
|
85
|
+
|
86
|
+
<li><span class="type">CLASS</span> <a href="Resque/Worker.html">Resque::Worker</a></li>
|
87
|
+
|
88
|
+
</ul>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<!-- Method Quickref -->
|
94
|
+
<div id="method-list-section" class="section">
|
95
|
+
<h3 class="section-header">Methods</h3>
|
96
|
+
<ul class="link-list">
|
97
|
+
|
98
|
+
<li><a href="#method-c-throttle">::throttle</a></li>
|
99
|
+
|
100
|
+
</ul>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
<div id="project-metadata">
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<div id="classindex-section" class="section project-section">
|
112
|
+
<h3 class="section-header">Class/Module Index
|
113
|
+
<span class="search-toggle"><img src="./images/find.png"
|
114
|
+
height="16" width="16" alt="[+]"
|
115
|
+
title="show/hide quicksearch" /></span></h3>
|
116
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
117
|
+
<fieldset>
|
118
|
+
<legend>Quicksearch</legend>
|
119
|
+
<input type="text" name="quicksearch" value=""
|
120
|
+
class="quicksearch-field" />
|
121
|
+
</fieldset>
|
122
|
+
</form>
|
123
|
+
|
124
|
+
<ul class="link-list">
|
125
|
+
|
126
|
+
<li><a href="./Resque.html">Resque</a></li>
|
127
|
+
|
128
|
+
<li><a href="./Resque/ChainedJobWithStatus.html">Resque::ChainedJobWithStatus</a></li>
|
129
|
+
|
130
|
+
<li><a href="./Resque/Failure.html">Resque::Failure</a></li>
|
131
|
+
|
132
|
+
<li><a href="./Resque/Job.html">Resque::Job</a></li>
|
133
|
+
|
134
|
+
<li><a href="./Resque/JobWithStatus.html">Resque::JobWithStatus</a></li>
|
135
|
+
|
136
|
+
<li><a href="./Resque/Status.html">Resque::Status</a></li>
|
137
|
+
|
138
|
+
<li><a href="./Resque/Worker.html">Resque::Worker</a></li>
|
139
|
+
|
140
|
+
<li><a href="./ResqueUi.html">ResqueUi</a></li>
|
141
|
+
|
142
|
+
<li><a href="./ResqueUi/Cap.html">ResqueUi::Cap</a></li>
|
143
|
+
|
144
|
+
<li><a href="./ResqueUi/Engine.html">ResqueUi::Engine</a></li>
|
145
|
+
|
146
|
+
<li><a href="./ResqueScheduler.html">ResqueScheduler</a></li>
|
147
|
+
|
148
|
+
</ul>
|
149
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
|
156
|
+
<div id="documentation">
|
157
|
+
<h1 class="module">Resque</h1>
|
158
|
+
|
159
|
+
<div id="description" class="description">
|
160
|
+
|
161
|
+
</div><!-- description -->
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
<!-- Methods -->
|
176
|
+
|
177
|
+
<div id="public-class-method-details" class="method-section section">
|
178
|
+
<h3 class="section-header">Public Class Methods</h3>
|
179
|
+
|
180
|
+
|
181
|
+
<div id="throttle-method" class="method-detail ">
|
182
|
+
<a name="method-c-throttle"></a>
|
183
|
+
|
184
|
+
|
185
|
+
<div class="method-heading">
|
186
|
+
<span class="method-name">throttle</span><span
|
187
|
+
class="method-args">(queue, limit = 10000, sleep_for = 60)</span>
|
188
|
+
<span class="method-click-advice">click to toggle source</span>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
|
192
|
+
<div class="method-description">
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
<div class="method-source-code" id="throttle-source">
|
199
|
+
<pre>
|
200
|
+
<span class="ruby-comment"># File lib/resque_ui/overrides/resque/resque.rb, line 2</span>
|
201
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">throttle</span>(<span class="ruby-identifier">queue</span>, <span class="ruby-identifier">limit</span> = <span class="ruby-value">10000</span>, <span class="ruby-identifier">sleep_for</span> = <span class="ruby-value">60</span>)
|
202
|
+
<span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
|
203
|
+
<span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Resque</span>.<span class="ruby-identifier">size</span>(<span class="ruby-identifier">queue</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-operator"><</span> <span class="ruby-identifier">limit</span>
|
204
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-identifier">sleep_for</span>
|
205
|
+
<span class="ruby-keyword">end</span>
|
206
|
+
<span class="ruby-keyword">end</span></pre>
|
207
|
+
</div><!-- throttle-source -->
|
208
|
+
|
209
|
+
</div>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
</div><!-- throttle-method -->
|
215
|
+
|
216
|
+
|
217
|
+
</div><!-- public-class-method-details -->
|
218
|
+
|
219
|
+
</div><!-- 5Buntitled-5D -->
|
220
|
+
|
221
|
+
|
222
|
+
</div><!-- documentation -->
|
223
|
+
|
224
|
+
<div id="validator-badges">
|
225
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
226
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
227
|
+
Rdoc Generator</a> 2</small>.</p>
|
228
|
+
</div>
|
229
|
+
|
230
|
+
</body>
|
231
|
+
</html>
|
232
|
+
|
@@ -0,0 +1,434 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Module: ResqueScheduler</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
<script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body id="top" class="module">
|
19
|
+
|
20
|
+
<div id="metadata">
|
21
|
+
<div id="home-metadata">
|
22
|
+
<div id="home-section" class="section">
|
23
|
+
<h3 class="section-header">
|
24
|
+
<a href="./index.html">Home</a>
|
25
|
+
<a href="./index.html#classes">Classes</a>
|
26
|
+
<a href="./index.html#methods">Methods</a>
|
27
|
+
</h3>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div id="file-metadata">
|
32
|
+
<div id="file-list-section" class="section">
|
33
|
+
<h3 class="section-header">In Files</h3>
|
34
|
+
<div class="section-body">
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li><a href="./lib/resque_ui/overrides/resque_scheduler/resque_scheduler_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="lib/resque_ui/overrides/resque_scheduler/resque_scheduler.rb">lib/resque_ui/overrides/resque_scheduler/resque_scheduler.rb</a></li>
|
39
|
+
|
40
|
+
</ul>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
<!-- Method Quickref -->
|
56
|
+
<div id="method-list-section" class="section">
|
57
|
+
<h3 class="section-header">Methods</h3>
|
58
|
+
<ul class="link-list">
|
59
|
+
|
60
|
+
<li><a href="#method-c-farm_status">::farm_status</a></li>
|
61
|
+
|
62
|
+
<li><a href="#method-c-pids">::pids</a></li>
|
63
|
+
|
64
|
+
<li><a href="#method-c-quit">::quit</a></li>
|
65
|
+
|
66
|
+
<li><a href="#method-c-restart">::restart</a></li>
|
67
|
+
|
68
|
+
<li><a href="#method-c-start">::start</a></li>
|
69
|
+
|
70
|
+
<li><a href="#method-i-schedule">#schedule</a></li>
|
71
|
+
|
72
|
+
<li><a href="#method-i-schedule-3D">#schedule=</a></li>
|
73
|
+
|
74
|
+
</ul>
|
75
|
+
</div>
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
</div>
|
80
|
+
|
81
|
+
<div id="project-metadata">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<div id="classindex-section" class="section project-section">
|
86
|
+
<h3 class="section-header">Class/Module Index
|
87
|
+
<span class="search-toggle"><img src="./images/find.png"
|
88
|
+
height="16" width="16" alt="[+]"
|
89
|
+
title="show/hide quicksearch" /></span></h3>
|
90
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
91
|
+
<fieldset>
|
92
|
+
<legend>Quicksearch</legend>
|
93
|
+
<input type="text" name="quicksearch" value=""
|
94
|
+
class="quicksearch-field" />
|
95
|
+
</fieldset>
|
96
|
+
</form>
|
97
|
+
|
98
|
+
<ul class="link-list">
|
99
|
+
|
100
|
+
<li><a href="./Resque.html">Resque</a></li>
|
101
|
+
|
102
|
+
<li><a href="./Resque/ChainedJobWithStatus.html">Resque::ChainedJobWithStatus</a></li>
|
103
|
+
|
104
|
+
<li><a href="./Resque/Failure.html">Resque::Failure</a></li>
|
105
|
+
|
106
|
+
<li><a href="./Resque/Job.html">Resque::Job</a></li>
|
107
|
+
|
108
|
+
<li><a href="./Resque/JobWithStatus.html">Resque::JobWithStatus</a></li>
|
109
|
+
|
110
|
+
<li><a href="./Resque/Status.html">Resque::Status</a></li>
|
111
|
+
|
112
|
+
<li><a href="./Resque/Worker.html">Resque::Worker</a></li>
|
113
|
+
|
114
|
+
<li><a href="./ResqueUi.html">ResqueUi</a></li>
|
115
|
+
|
116
|
+
<li><a href="./ResqueUi/Cap.html">ResqueUi::Cap</a></li>
|
117
|
+
|
118
|
+
<li><a href="./ResqueUi/Engine.html">ResqueUi::Engine</a></li>
|
119
|
+
|
120
|
+
<li><a href="./ResqueScheduler.html">ResqueScheduler</a></li>
|
121
|
+
|
122
|
+
</ul>
|
123
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
124
|
+
</div>
|
125
|
+
|
126
|
+
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div id="documentation">
|
131
|
+
<h1 class="module">ResqueScheduler</h1>
|
132
|
+
|
133
|
+
<div id="description" class="description">
|
134
|
+
|
135
|
+
</div><!-- description -->
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
<!-- Methods -->
|
150
|
+
|
151
|
+
<div id="public-class-method-details" class="method-section section">
|
152
|
+
<h3 class="section-header">Public Class Methods</h3>
|
153
|
+
|
154
|
+
|
155
|
+
<div id="farm_status-method" class="method-detail ">
|
156
|
+
<a name="method-c-farm_status"></a>
|
157
|
+
|
158
|
+
|
159
|
+
<div class="method-heading">
|
160
|
+
<span class="method-name">farm_status</span><span
|
161
|
+
class="method-args">()</span>
|
162
|
+
<span class="method-click-advice">click to toggle source</span>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
|
166
|
+
<div class="method-description">
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
<div class="method-source-code" id="farm_status-source">
|
173
|
+
<pre>
|
174
|
+
<span class="ruby-comment"># File lib/resque_ui/overrides/resque_scheduler/resque_scheduler.rb, line 38</span>
|
175
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">farm_status</span>
|
176
|
+
<span class="ruby-identifier">status</span> = {}
|
177
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">env</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/development|test/</span>
|
178
|
+
<span class="ruby-identifier">status</span>[<span class="ruby-string">'localhost'</span>] = <span class="ruby-identifier">pids</span>.<span class="ruby-identifier">present?</span> <span class="ruby-operator">?</span> <span class="ruby-string">'Running'</span> <span class="ruby-operator">:</span> <span class="ruby-string">'Stopped'</span>
|
179
|
+
<span class="ruby-keyword">else</span>
|
180
|
+
<span class="ruby-constant">Resque</span>.<span class="ruby-identifier">schedule</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">job</span><span class="ruby-operator">|</span> <span class="ruby-identifier">job</span>[<span class="ruby-string">'ip'</span>]}.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ip</span><span class="ruby-operator">|</span>
|
181
|
+
<span class="ruby-identifier">cap</span> = <span class="ruby-node">`cd #{Rails.root}; #{ResqueUi::Cap.path} #{Rails.env} resque:scheduler_status hosts=#{ip}`</span>
|
182
|
+
<span class="ruby-identifier">status</span>[<span class="ruby-identifier">ip</span>] = <span class="ruby-identifier">cap</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/resque:scheduler is up/</span> <span class="ruby-operator">?</span> <span class="ruby-string">'Running'</span> <span class="ruby-operator">:</span> <span class="ruby-string">'Stopped'</span>
|
183
|
+
<span class="ruby-keyword">end</span>
|
184
|
+
<span class="ruby-keyword">end</span>
|
185
|
+
<span class="ruby-identifier">status</span>
|
186
|
+
<span class="ruby-keyword">end</span></pre>
|
187
|
+
</div><!-- farm_status-source -->
|
188
|
+
|
189
|
+
</div>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
</div><!-- farm_status-method -->
|
195
|
+
|
196
|
+
|
197
|
+
<div id="pids-method" class="method-detail ">
|
198
|
+
<a name="method-c-pids"></a>
|
199
|
+
|
200
|
+
|
201
|
+
<div class="method-heading">
|
202
|
+
<span class="method-name">pids</span><span
|
203
|
+
class="method-args">()</span>
|
204
|
+
<span class="method-click-advice">click to toggle source</span>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
<div class="method-description">
|
209
|
+
|
210
|
+
<p>Returns an array of string pids of all the other workers on this machine.
|
211
|
+
Useful when pruning dead workers on startup.</p>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
<div class="method-source-code" id="pids-source">
|
216
|
+
<pre>
|
217
|
+
<span class="ruby-comment"># File lib/resque_ui/overrides/resque_scheduler/resque_scheduler.rb, line 53</span>
|
218
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pids</span>
|
219
|
+
<span class="ruby-value">`ps -A -o pid,command | grep [r]esque:scheduler`</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">"\n"</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
220
|
+
<span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">' '</span>)[<span class="ruby-value">0</span>]
|
221
|
+
<span class="ruby-keyword">end</span>
|
222
|
+
<span class="ruby-keyword">end</span></pre>
|
223
|
+
</div><!-- pids-source -->
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
</div><!-- pids-method -->
|
231
|
+
|
232
|
+
|
233
|
+
<div id="quit-method" class="method-detail ">
|
234
|
+
<a name="method-c-quit"></a>
|
235
|
+
|
236
|
+
|
237
|
+
<div class="method-heading">
|
238
|
+
<span class="method-name">quit</span><span
|
239
|
+
class="method-args">(ips)</span>
|
240
|
+
<span class="method-click-advice">click to toggle source</span>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
|
244
|
+
<div class="method-description">
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
<div class="method-source-code" id="quit-source">
|
251
|
+
<pre>
|
252
|
+
<span class="ruby-comment"># File lib/resque_ui/overrides/resque_scheduler/resque_scheduler.rb, line 25</span>
|
253
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">quit</span>(<span class="ruby-identifier">ips</span>)
|
254
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">env</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/development|test/</span>
|
255
|
+
<span class="ruby-identifier">system</span>(<span class="ruby-string">"rake resque:quit_scheduler"</span>)
|
256
|
+
<span class="ruby-keyword">else</span>
|
257
|
+
<span class="ruby-identifier">system</span>(<span class="ruby-node">"cd #{Rails.root}; #{ResqueUi::Cap.path} #{Rails.env} resque:quit_scheduler host=#{ips}"</span>)
|
258
|
+
<span class="ruby-keyword">end</span>
|
259
|
+
<span class="ruby-keyword">end</span></pre>
|
260
|
+
</div><!-- quit-source -->
|
261
|
+
|
262
|
+
</div>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
</div><!-- quit-method -->
|
268
|
+
|
269
|
+
|
270
|
+
<div id="restart-method" class="method-detail ">
|
271
|
+
<a name="method-c-restart"></a>
|
272
|
+
|
273
|
+
|
274
|
+
<div class="method-heading">
|
275
|
+
<span class="method-name">restart</span><span
|
276
|
+
class="method-args">(ips)</span>
|
277
|
+
<span class="method-click-advice">click to toggle source</span>
|
278
|
+
</div>
|
279
|
+
|
280
|
+
|
281
|
+
<div class="method-description">
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
<div class="method-source-code" id="restart-source">
|
288
|
+
<pre>
|
289
|
+
<span class="ruby-comment"># File lib/resque_ui/overrides/resque_scheduler/resque_scheduler.rb, line 33</span>
|
290
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">restart</span>(<span class="ruby-identifier">ips</span>)
|
291
|
+
<span class="ruby-identifier">quit</span>(<span class="ruby-identifier">ips</span>)
|
292
|
+
<span class="ruby-identifier">start</span>(<span class="ruby-identifier">ips</span>)
|
293
|
+
<span class="ruby-keyword">end</span></pre>
|
294
|
+
</div><!-- restart-source -->
|
295
|
+
|
296
|
+
</div>
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
</div><!-- restart-method -->
|
302
|
+
|
303
|
+
|
304
|
+
<div id="start-method" class="method-detail ">
|
305
|
+
<a name="method-c-start"></a>
|
306
|
+
|
307
|
+
|
308
|
+
<div class="method-heading">
|
309
|
+
<span class="method-name">start</span><span
|
310
|
+
class="method-args">(ips)</span>
|
311
|
+
<span class="method-click-advice">click to toggle source</span>
|
312
|
+
</div>
|
313
|
+
|
314
|
+
|
315
|
+
<div class="method-description">
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
<div class="method-source-code" id="start-source">
|
322
|
+
<pre>
|
323
|
+
<span class="ruby-comment"># File lib/resque_ui/overrides/resque_scheduler/resque_scheduler.rb, line 17</span>
|
324
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">start</span>(<span class="ruby-identifier">ips</span>)
|
325
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">env</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/development|test/</span>
|
326
|
+
<span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span>{<span class="ruby-identifier">system</span>(<span class="ruby-string">"rake resque:scheduler"</span>)}
|
327
|
+
<span class="ruby-keyword">else</span>
|
328
|
+
<span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ips</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">ip_list</span><span class="ruby-operator">|</span><span class="ruby-identifier">system</span>(<span class="ruby-node">"cd #{Rails.root}; #{ResqueUi::Cap.path} #{Rails.env} resque:scheduler host=#{ip_list}"</span>)}
|
329
|
+
<span class="ruby-keyword">end</span>
|
330
|
+
<span class="ruby-keyword">end</span></pre>
|
331
|
+
</div><!-- start-source -->
|
332
|
+
|
333
|
+
</div>
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
</div><!-- start-method -->
|
339
|
+
|
340
|
+
|
341
|
+
</div><!-- public-class-method-details -->
|
342
|
+
|
343
|
+
<div id="public-instance-method-details" class="method-section section">
|
344
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
345
|
+
|
346
|
+
|
347
|
+
<div id="schedule-method" class="method-detail ">
|
348
|
+
<a name="method-i-schedule"></a>
|
349
|
+
|
350
|
+
|
351
|
+
<div class="method-heading">
|
352
|
+
<span class="method-name">schedule</span><span
|
353
|
+
class="method-args">()</span>
|
354
|
+
<span class="method-click-advice">click to toggle source</span>
|
355
|
+
</div>
|
356
|
+
|
357
|
+
|
358
|
+
<div class="method-description">
|
359
|
+
|
360
|
+
<p>Returns the schedule hash</p>
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
<div class="method-source-code" id="schedule-source">
|
365
|
+
<pre>
|
366
|
+
<span class="ruby-comment"># File lib/resque_ui/overrides/resque_scheduler/resque_scheduler.rb, line 7</span>
|
367
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">schedule</span>
|
368
|
+
<span class="ruby-comment">#the scheduler gem expects a hash, but it's now stored in</span>
|
369
|
+
<span class="ruby-comment">#redis as an array.</span>
|
370
|
+
<span class="ruby-identifier">hash</span> = {}
|
371
|
+
<span class="ruby-constant">Resque</span>.<span class="ruby-identifier">list_range</span>(<span class="ruby-value">:scheduled</span>, <span class="ruby-value">0</span>, <span class="ruby-value">-0</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">job</span><span class="ruby-operator">|</span>
|
372
|
+
<span class="ruby-identifier">hash</span>.<span class="ruby-identifier">merge!</span> <span class="ruby-identifier">job</span>
|
373
|
+
<span class="ruby-keyword">end</span>
|
374
|
+
<span class="ruby-identifier">hash</span>
|
375
|
+
<span class="ruby-keyword">end</span></pre>
|
376
|
+
</div><!-- schedule-source -->
|
377
|
+
|
378
|
+
</div>
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
</div><!-- schedule-method -->
|
384
|
+
|
385
|
+
|
386
|
+
<div id="schedule-3D-method" class="method-detail ">
|
387
|
+
<a name="method-i-schedule-3D"></a>
|
388
|
+
|
389
|
+
|
390
|
+
<div class="method-heading">
|
391
|
+
<span class="method-name">schedule=</span><span
|
392
|
+
class="method-args">(schedule_hash)</span>
|
393
|
+
<span class="method-click-advice">click to toggle source</span>
|
394
|
+
</div>
|
395
|
+
|
396
|
+
|
397
|
+
<div class="method-description">
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
<div class="method-source-code" id="schedule-3D-source">
|
404
|
+
<pre>
|
405
|
+
<span class="ruby-comment"># File lib/resque_ui/overrides/resque_scheduler/resque_scheduler.rb, line 2</span>
|
406
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">schedule=</span>(<span class="ruby-identifier">schedule_hash</span>)
|
407
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">'not implemented'</span>
|
408
|
+
<span class="ruby-keyword">end</span></pre>
|
409
|
+
</div><!-- schedule-3D-source -->
|
410
|
+
|
411
|
+
</div>
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
</div><!-- schedule-3D-method -->
|
417
|
+
|
418
|
+
|
419
|
+
</div><!-- public-instance-method-details -->
|
420
|
+
|
421
|
+
</div><!-- 5Buntitled-5D -->
|
422
|
+
|
423
|
+
|
424
|
+
</div><!-- documentation -->
|
425
|
+
|
426
|
+
<div id="validator-badges">
|
427
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
428
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
429
|
+
Rdoc Generator</a> 2</small>.</p>
|
430
|
+
</div>
|
431
|
+
|
432
|
+
</body>
|
433
|
+
</html>
|
434
|
+
|