Created
          December 16, 2010 15:48 
        
      - 
      
- 
        Save joshuaclayton/743548 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or 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
    
  
  
    
  | class FakeResque | |
| cattr_accessor :queue | |
| self.queue = [] | |
| def self.enqueue(klass, *args) | |
| self.queue << [klass, args.to_json] | |
| end | |
| def self.run_jobs | |
| while !self.queue.empty? | |
| args = self.queue.pop | |
| klass, args = args.shift, args.shift | |
| klass.send(:perform, *JSON.parse(args)) | |
| end | |
| end | |
| def self.reset | |
| self.queue = [] | |
| end | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment