Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shereef Bishay
committed
Jan 9, 2010
1 parent
ff57ff8
commit 9f06e45
Showing
35 changed files
with
844 additions
and
543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,20 @@ | |||
class CreateDelayedJobs < ActiveRecord::Migration | |||
def self.up | |||
create_table :delayed_jobs, :force => true do |table| | |||
table.integer :priority, :default => 0 # Allows some jobs to jump to the front of the queue | |||
table.integer :attempts, :default => 0 # Provides for retries, but still fail eventually. | |||
table.text :handler # YAML-encoded string of the object that will do work | |||
table.text :last_error # reason for last failure (See Note below) | |||
table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future. | |||
table.datetime :locked_at # Set when a client is working on this object | |||
table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) | |||
table.string :locked_by # Who is working on this object (if locked) | |||
table.timestamps | |||
end | |||
|
|||
end | |||
|
|||
def self.down | |||
drop_table :delayed_jobs | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
#!/usr/bin/env ruby | |||
|
|||
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment')) | |||
require 'delayed/command' | |||
Delayed::Command.new(ARGV).daemonize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,38 @@ | |||
# -*- encoding: utf-8 -*- | |||
begin | |||
require 'jeweler' | |||
rescue LoadError | |||
puts "Jeweler not available. Install it with: sudo gem install jeweler" | |||
exit 1 | |||
end | |||
|
|||
Jeweler::Tasks.new do |s| | |||
s.name = "delayed_job" | |||
s.summary = "Database-backed asynchronous priority queue system -- Extracted from Shopify" | |||
s.email = "tobi@leetsoft.com" | |||
s.homepage = "http://github.com/collectiveidea/delayed_job" | |||
s.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." | |||
s.authors = ["Brandon Keepers", "Tobias Lütke"] | |||
|
|||
s.has_rdoc = true | |||
s.rdoc_options = ["--main", "README.textile", "--inline-source", "--line-numbers"] | |||
s.extra_rdoc_files = ["README.textile"] | |||
|
|||
s.test_files = Dir['spec/**/*'] | |||
|
|||
s.add_development_dependency "rspec" | |||
s.add_development_dependency "sqlite3-ruby" | |||
end | |||
|
|||
require 'spec/rake/spectask' | |||
|
|||
task :default => :spec | |||
|
|||
desc 'Run the specs' | |||
Spec::Rake::SpecTask.new(:spec) do |t| | |||
t.libs << 'lib' | |||
t.pattern = 'spec/**/*_spec.rb' | |||
t.verbose = true | |||
end | |||
task :spec => :check_dependencies | |||
|
Oops, something went wrong.