I am new for redis and currently I am using PHP resque for redis. How can I define a job in php resque?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Queueing Jobs
Jobs are queued as follows:
Resque::enqueue(‘default’, ‘My_Job’, $args);
Defining Jobs
Each job should be in it’s own class, and include a perform method.
When the job is run, the class will be instantiated and any arguments will be set as an array on the instantiated object, and are accessible via $this->args.
Any exception thrown by a job will result in the job failing – be careful here and make sure you handle the exceptions that shouldn’t result in a job failing.