TheSchwartz Perl module is a very useful, powerful and sometimes funny queueing system. It can be used for triggering all sort of events like sending email, running print jobs, and generating reports just to name a few. Recently I used it in a project to send SMS messages via the Twilio SMS service in conjunction with its respective Twilio Perl module. Typically, jobs such as these are triggered by a user submitting a web request, which then inserts a schwartz job record into the database for processing. But one of the best things about this module is actually using it, by typing "use TheSchwartz". A humourous nod to Spaceballs that's sheer genious.

TheSchwartz module contains several core functionalities to enable synchronous job processing. The "job" function of the module consists of creating a database record that stores a job's function type and various argument values for future processing. The "worker" function scans the jobs records table and executes a job record based on its function type and timing definitions. Once a job is processed, the module marks it as completed or failed. Failure error messages are stored in the database for troubleshooting purposes. Once a job has had its turn being processed, the system grabs the next available job and continues the processes.