threefunkymonkeys/funky-world-cup — pull request #118 by kandalf (2014-06-07 05:34:59+00:00)
Title: 97 bis new worker jobs format

This PR proposes a new Job format, moving the EventMachine handling to the worker file.
To make this possible it assumes a convention within the job filename and the job class the file contains.
This adds decoupling and flexibility and get these things ready to be moved to a gem.
To help creating the jobs classes it adds a base class [BaseJob](https://github.com/threefunkymonkeys/funky-world-cup/blob/00fe4d74c3d51aecc520313e3e1e8370b5821a20/lib/base_job.rb) to provide a common interface to the jobs classes and complaining if you miss some data required by the worker at the moment of running the job.

So, long story short:
Your file `jobs/update_results.rb` needs to hold a class named `UpdateResultsJob`, which should inherit from `BaseJob`.
Your class `UpdateResultsJob` must reimplement `self.interval` and `self.run`, both self explanatory, and it also may reimplement `self.message` for the logging message when the job is run.