toro 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +5 -5
- data/lib/tasks/tasks.rb +5 -3
- data/lib/toro/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -96,7 +96,7 @@ MyWorker.perform_async(15)
|
|
96
96
|
|
97
97
|
Start Toro in the root directory of your Rails app:
|
98
98
|
```bash
|
99
|
-
rake toro
|
99
|
+
rake toro
|
100
100
|
```
|
101
101
|
|
102
102
|
Basics
|
@@ -123,13 +123,13 @@ end
|
|
123
123
|
To set a process's queue, use `-q`:
|
124
124
|
|
125
125
|
```bash
|
126
|
-
rake toro
|
126
|
+
rake toro -- -q users
|
127
127
|
```
|
128
128
|
|
129
129
|
Or specify multiple queues:
|
130
130
|
|
131
131
|
```bash
|
132
|
-
rake toro
|
132
|
+
rake toro -- -q users -q comments
|
133
133
|
```
|
134
134
|
|
135
135
|
### Concurrency
|
@@ -137,7 +137,7 @@ rake toro:start -- -q users -q comments
|
|
137
137
|
To specify a process's concurrency (how many jobs it can run simultaneously), use `-c`:
|
138
138
|
|
139
139
|
```bash
|
140
|
-
rake toro
|
140
|
+
rake toro -- -c 10
|
141
141
|
```
|
142
142
|
|
143
143
|
### Scheduled Jobs
|
@@ -438,7 +438,7 @@ mount Toro::Monitor::Engine => '/toro', :constraints => AdminConstraint.new
|
|
438
438
|
|
439
439
|
Checks a `User` model instance that responds to `admin?`
|
440
440
|
|
441
|
-
```
|
441
|
+
```ruby
|
442
442
|
# lib/admin_constraint.rb
|
443
443
|
class AdminConstraint
|
444
444
|
def matches?(request)
|
data/lib/tasks/tasks.rb
CHANGED
@@ -1,19 +1,21 @@
|
|
1
1
|
task :environment
|
2
2
|
|
3
3
|
namespace :toro do
|
4
|
-
desc
|
4
|
+
desc 'Start processing Toro jobs'
|
5
5
|
task :start => :environment do
|
6
6
|
cli = Toro::CLI.new
|
7
7
|
cli.run
|
8
8
|
end
|
9
9
|
|
10
|
-
desc
|
10
|
+
desc 'Add Toro tables and functions to the database'
|
11
11
|
task :up => :environment do
|
12
12
|
Toro::Database.up
|
13
13
|
end
|
14
14
|
|
15
|
-
desc
|
15
|
+
desc 'Remove Toro tables and functions from the database'
|
16
16
|
task :down => :environment do
|
17
17
|
Toro::Database.down
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
21
|
+
task :toro => 'toro:start'
|
data/lib/toro/version.rb
CHANGED