collectiveidea-delayed_job 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/MIT-LICENSE +20 -0
- data/README.textile +107 -0
- data/Rakefile +22 -0
- data/VERSION +1 -0
- data/delayed_job.gemspec +61 -0
- data/generators/delayed_job/delayed_job_generator.rb +11 -0
- data/generators/delayed_job/templates/migration.rb +20 -0
- data/generators/delayed_job/templates/script +7 -0
- data/init.rb +1 -0
- data/lib/delayed/command.rb +65 -0
- data/lib/delayed/job.rb +271 -0
- data/lib/delayed/message_sending.rb +17 -0
- data/lib/delayed/performable_method.rb +55 -0
- data/lib/delayed/worker.rb +54 -0
- data/lib/delayed_job.rb +13 -0
- data/recipes/delayed_job.rb +26 -0
- data/spec/database.rb +42 -0
- data/spec/delayed_method_spec.rb +128 -0
- data/spec/job_spec.rb +389 -0
- data/spec/story_spec.rb +17 -0
- data/tasks/jobs.rake +1 -0
- data/tasks/tasks.rb +15 -0
- metadata +81 -0
data/spec/story_spec.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/database'
|
2
|
+
|
3
|
+
describe "A story" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
@story = Story.create :text => "Once upon a time..."
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should be shared" do
|
10
|
+
@story.tell.should == 'Once upon a time...'
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should not return its result if it storytelling is delayed" do
|
14
|
+
@story.send_later(:tell).should_not == 'Once upon a time...'
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
data/tasks/jobs.rake
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'tasks')
|
data/tasks/tasks.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Re-definitions are appended to existing tasks
|
2
|
+
task :environment
|
3
|
+
task :merb_env
|
4
|
+
|
5
|
+
namespace :jobs do
|
6
|
+
desc "Clear the delayed_job queue."
|
7
|
+
task :clear => [:merb_env, :environment] do
|
8
|
+
Delayed::Job.delete_all
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "Start a delayed_job worker."
|
12
|
+
task :work => [:merb_env, :environment] do
|
13
|
+
Delayed::Worker.new(:min_priority => ENV['MIN_PRIORITY'], :max_priority => ENV['MAX_PRIORITY']).start
|
14
|
+
end
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: collectiveidea-delayed_job
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.8.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- "Tobias L\xC3\xBCtke"
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-07-19 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks.
|
17
|
+
email: tobi@leetsoft.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.textile
|
24
|
+
files:
|
25
|
+
- .gitignore
|
26
|
+
- MIT-LICENSE
|
27
|
+
- README.textile
|
28
|
+
- Rakefile
|
29
|
+
- VERSION
|
30
|
+
- delayed_job.gemspec
|
31
|
+
- generators/delayed_job/delayed_job_generator.rb
|
32
|
+
- generators/delayed_job/templates/migration.rb
|
33
|
+
- generators/delayed_job/templates/script
|
34
|
+
- init.rb
|
35
|
+
- lib/delayed/command.rb
|
36
|
+
- lib/delayed/job.rb
|
37
|
+
- lib/delayed/message_sending.rb
|
38
|
+
- lib/delayed/performable_method.rb
|
39
|
+
- lib/delayed/worker.rb
|
40
|
+
- lib/delayed_job.rb
|
41
|
+
- recipes/delayed_job.rb
|
42
|
+
- spec/database.rb
|
43
|
+
- spec/delayed_method_spec.rb
|
44
|
+
- spec/job_spec.rb
|
45
|
+
- spec/story_spec.rb
|
46
|
+
- tasks/jobs.rake
|
47
|
+
- tasks/tasks.rb
|
48
|
+
has_rdoc: false
|
49
|
+
homepage: http://github.com/tobi/delayed_job/tree/master
|
50
|
+
post_install_message:
|
51
|
+
rdoc_options:
|
52
|
+
- --main
|
53
|
+
- README.textile
|
54
|
+
- --inline-source
|
55
|
+
- --line-numbers
|
56
|
+
require_paths:
|
57
|
+
- lib
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: "0"
|
63
|
+
version:
|
64
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: "0"
|
69
|
+
version:
|
70
|
+
requirements: []
|
71
|
+
|
72
|
+
rubyforge_project:
|
73
|
+
rubygems_version: 1.2.0
|
74
|
+
signing_key:
|
75
|
+
specification_version: 3
|
76
|
+
summary: Database-backed asynchronous priority queue system -- Extracted from Shopify
|
77
|
+
test_files:
|
78
|
+
- spec/database.rb
|
79
|
+
- spec/delayed_method_spec.rb
|
80
|
+
- spec/job_spec.rb
|
81
|
+
- spec/story_spec.rb
|