-
Start Postgres and create the database:
brew services start postgresql createdb delayed-job-test
-
Configure the database connection:
export DB=postgres:///delayed-job-test
-
Run migrations:
sequel -m db/migrations $DB
-
Start the job processing daemon:
./scripts/process-jobs run
-
Provide the mail body on
STDIN
and the email addresses as parameters:echo "Dear number $RANDOM, you are an awesome number! Best regards; The Computer." | ./scripts/enqueue-job [email protected] [email protected]
Here, we are sending a letter to [email protected] and [email protected], each as a single job.
-
Verify that the mailer ran (we simulate it by appending to a 'queue' file):
tail -f log/mail.queue
Additional details about the job itself can be found in
log/delayed_job.log
.