toro 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -13
- data/lib/toro/listener.rb +1 -1
- data/lib/toro/sql/up.sql +2 -1
- data/lib/toro/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Toro
|
2
2
|
====
|
3
|
-
|
3
|
+
Transparent, extensible background processing for Ruby & PostgreSQL
|
4
4
|
|
5
5
|
Overview
|
6
6
|
--------
|
@@ -17,7 +17,7 @@ An extensive dashboard:
|
|
17
17
|
* Sort jobs by queue, worker, start time, queued time, duration, customizable name, status
|
18
18
|
* Filter jobs by queue, worker, customizable name, status
|
19
19
|
* Stacked histograms show the status distribution for each queue
|
20
|
-
* A process table
|
20
|
+
* A process table shows which machines/processes are active and which jobs they're running
|
21
21
|
* Buttons for manually retrying failed jobs
|
22
22
|
* Job detail view with in-depth job information:
|
23
23
|
* Basics: worker class, arguments, start time, duration, process name
|
@@ -267,7 +267,7 @@ big_jobs = Toro::Job.where("(properties->'comments_count')::int > ?", 100)
|
|
267
267
|
|
268
268
|
#### Associating Jobs with Other Models
|
269
269
|
|
270
|
-
You can create associations between jobs and other models using
|
270
|
+
You can create associations between jobs and other models using job properties:
|
271
271
|
|
272
272
|
```ruby
|
273
273
|
class User < ActiveRecord::Base
|
@@ -344,15 +344,6 @@ The UI uses polling to update its data. By default, the polling interval is 3000
|
|
344
344
|
Toro::Monitor.options[:poll_interval] = 5000
|
345
345
|
```
|
346
346
|
|
347
|
-
### Custom Statuses
|
348
|
-
|
349
|
-
The UI's status filter and histograms show the most common job statuses, but if you'd like to add additional statuses to them (for example, if you have added custom statuses through middleware), you can make the UI include them like so:
|
350
|
-
|
351
|
-
```ruby
|
352
|
-
# config/initializers/toro.rb
|
353
|
-
Toro::Monitor::Job.add_status('my_custom_status')
|
354
|
-
```
|
355
|
-
|
356
347
|
### Custom Job Views
|
357
348
|
|
358
349
|
When you click on a job, a modal showing its properties is displayed. You can add subviews to this modal by creating a view in your app and calling `Toro::Monitor::CustomViews.add`, passing it the subview's title, the subview's filepath, and a block. The subview is only rendered if the block evaluates to true for the given job.
|
@@ -519,7 +510,7 @@ FAQ
|
|
519
510
|
### Toro?
|
520
511
|
* [Toro](http://en.wikipedia.org/wiki/Tuna) is robust, quick, and values strength in numbers.
|
521
512
|
* [Toro](http://en.wikipedia.org/wiki/Bull) is durable and runs a little large.
|
522
|
-
* [Toro](http://en.wikipedia.org/wiki/T%C5%8Dr%C5%8D)
|
513
|
+
* [Toro](http://en.wikipedia.org/wiki/T%C5%8Dr%C5%8D) values visibility.
|
523
514
|
|
524
515
|
|
525
516
|
Notes
|
data/lib/toro/listener.rb
CHANGED
@@ -13,10 +13,10 @@ module Toro
|
|
13
13
|
@is_done = false
|
14
14
|
raise 'No fetcher provided' if @fetcher.blank?
|
15
15
|
raise 'No manager provided' if @manager.blank?
|
16
|
+
@manager.register_actor(:listener, self)
|
16
17
|
end
|
17
18
|
|
18
19
|
def start
|
19
|
-
@manager.register_actor(:listener, self)
|
20
20
|
Toro::Database.with_connection do
|
21
21
|
Toro::Database.raw_connection.async_exec(channels.map { |channel| "LISTEN #{channel}" }.join('; '))
|
22
22
|
wait_for_notify
|
data/lib/toro/sql/up.sql
CHANGED
@@ -20,7 +20,8 @@ CREATE TABLE toro_jobs (
|
|
20
20
|
|
21
21
|
END $$ LANGUAGE plpgsql;
|
22
22
|
|
23
|
-
CREATE FUNCTION toro_notify() RETURNS TRIGGER AS $$
|
23
|
+
CREATE FUNCTION toro_notify() RETURNS TRIGGER AS $$
|
24
|
+
BEGIN
|
24
25
|
PERFORM pg_notify('toro_' || new.queue, '');
|
25
26
|
RETURN NULL;
|
26
27
|
END $$ LANGUAGE plpgsql;
|
data/lib/toro/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: celluloid
|
@@ -155,7 +155,7 @@ dependencies:
|
|
155
155
|
- - ! '>='
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
|
-
description:
|
158
|
+
description: Transparent, extensible background processing for Ruby & PostgreSQL
|
159
159
|
email:
|
160
160
|
- tombenner@gmail.com
|
161
161
|
executables: []
|
@@ -218,5 +218,5 @@ rubyforge_project:
|
|
218
218
|
rubygems_version: 1.8.24
|
219
219
|
signing_key:
|
220
220
|
specification_version: 3
|
221
|
-
summary:
|
221
|
+
summary: Transparent, extensible background processing for Ruby & PostgreSQL
|
222
222
|
test_files: []
|