76. how ?
jobs are queued as follows
require_once 'lib/Resque.php';
// Required if redis is located elsewhere
Resque::setBackend('localhost:6379');
$args = array(
'name' => 'Chris'
);
Resque::enqueue('default', 'My_Job', $args);
78. job class
class My_Job
{
public function setUp()
{
// ... Set up environment for this job
}
public function perform()
{
// .. Run job
}
public function tearDown()
{
// ... Remove environment for this job
}
}
hello and welcome to my talk on php-resque\nbefore we proceed i have to tell you all that php-resque was developed by chris boulton\nmy name is chaitanya kuber and can be contacted via twitter\n
hello and welcome to my talk on php-resque\nbefore we proceed i have to tell you all that php-resque was developed by chris boulton\nmy name is chaitanya kuber and can be contacted via twitter\n
hello and welcome to my talk on php-resque\nbefore we proceed i have to tell you all that php-resque was developed by chris boulton\nmy name is chaitanya kuber and can be contacted via twitter\n
standing here and doing this presentaiton is a little strange because i know everyone in the audience is smarter than myself\nthat said, i want to provide a little bit of context about our world\ntalk about what resque is and how it works\nthe move to php\nwhat we use it for @ bigcommerce\n\n
standing here and doing this presentaiton is a little strange because i know everyone in the audience is smarter than myself\nthat said, i want to provide a little bit of context about our world\ntalk about what resque is and how it works\nthe move to php\nwhat we use it for @ bigcommerce\n\n
standing here and doing this presentaiton is a little strange because i know everyone in the audience is smarter than myself\nthat said, i want to provide a little bit of context about our world\ntalk about what resque is and how it works\nthe move to php\nwhat we use it for @ bigcommerce\n\n
standing here and doing this presentaiton is a little strange because i know everyone in the audience is smarter than myself\nthat said, i want to provide a little bit of context about our world\ntalk about what resque is and how it works\nthe move to php\nwhat we use it for @ bigcommerce\n\n
context, it really is everything\nin engineering web applications its all about the milliseconds\ntasks like …. take time\nthey not only take time, often they are supporting tasks\nthings that do not directly impact servicing a request form the user\n
context, it really is everything\nin engineering web applications its all about the milliseconds\ntasks like …. take time\nthey not only take time, often they are supporting tasks\nthings that do not directly impact servicing a request form the user\n
context, it really is everything\nin engineering web applications its all about the milliseconds\ntasks like …. take time\nthey not only take time, often they are supporting tasks\nthings that do not directly impact servicing a request form the user\n
context, it really is everything\nin engineering web applications its all about the milliseconds\ntasks like …. take time\nthey not only take time, often they are supporting tasks\nthings that do not directly impact servicing a request form the user\n
context, it really is everything\nin engineering web applications its all about the milliseconds\ntasks like …. take time\nthey not only take time, often they are supporting tasks\nthings that do not directly impact servicing a request form the user\n
users are fickle\ni like to think that a web application should focus on responding as fast possible to the request form its user\nif not they will leave\nso, any operation thats not directly related to the request can and probably should go elsewhere\n\n
where ?\nbackground jobs … whats that\nthink asynchronous\nsupermarket shelves are stacked in the night to ensure shoppers can walk in get there things and walk out\nit would be a sucky experience to walk in and wait for them to stock the milk before you could buy it\n
where ?\nbackground jobs … whats that\nthink asynchronous\nsupermarket shelves are stacked in the night to ensure shoppers can walk in get there things and walk out\nit would be a sucky experience to walk in and wait for them to stock the milk before you could buy it\n
there are various systems to do background/async processing\nbackgroundjob is a zero admin background priority queue for rails\ndelayedjob is similar with the advantage that it doesn’t load the entire rails env into memory\nbeanstalk is a simple, fast work queue. its interface is generic, was designed for increase response times for high-volume web apps\ngearman is quite similar to resque as it supports persistant queues, is open source, fault tolerant and is distributed\n
there are various systems to do background/async processing\nbackgroundjob is a zero admin background priority queue for rails\ndelayedjob is similar with the advantage that it doesn’t load the entire rails env into memory\nbeanstalk is a simple, fast work queue. its interface is generic, was designed for increase response times for high-volume web apps\ngearman is quite similar to resque as it supports persistant queues, is open source, fault tolerant and is distributed\n
there are various systems to do background/async processing\nbackgroundjob is a zero admin background priority queue for rails\ndelayedjob is similar with the advantage that it doesn’t load the entire rails env into memory\nbeanstalk is a simple, fast work queue. its interface is generic, was designed for increase response times for high-volume web apps\ngearman is quite similar to resque as it supports persistant queues, is open source, fault tolerant and is distributed\n
there are various systems to do background/async processing\nbackgroundjob is a zero admin background priority queue for rails\ndelayedjob is similar with the advantage that it doesn’t load the entire rails env into memory\nbeanstalk is a simple, fast work queue. its interface is generic, was designed for increase response times for high-volume web apps\ngearman is quite similar to resque as it supports persistant queues, is open source, fault tolerant and is distributed\n
there are various systems to do background/async processing\nbackgroundjob is a zero admin background priority queue for rails\ndelayedjob is similar with the advantage that it doesn’t load the entire rails env into memory\nbeanstalk is a simple, fast work queue. its interface is generic, was designed for increase response times for high-volume web apps\ngearman is quite similar to resque as it supports persistant queues, is open source, fault tolerant and is distributed\n
there are various systems to do background/async processing\nbackgroundjob is a zero admin background priority queue for rails\ndelayedjob is similar with the advantage that it doesn’t load the entire rails env into memory\nbeanstalk is a simple, fast work queue. its interface is generic, was designed for increase response times for high-volume web apps\ngearman is quite similar to resque as it supports persistant queues, is open source, fault tolerant and is distributed\n
it was developed by the cool folks @github, it was inspired by delayedjob\nresque is written in ruby which is a redis backed library for creating background jobs, placing them in queues and processing them later\nworkers can process one or multiple queues\nworkers can be run on different servers\n
it was developed by the cool folks @github, it was inspired by delayedjob\nresque is written in ruby which is a redis backed library for creating background jobs, placing them in queues and processing them later\nworkers can process one or multiple queues\nworkers can be run on different servers\n
it was developed by the cool folks @github, it was inspired by delayedjob\nresque is written in ruby which is a redis backed library for creating background jobs, placing them in queues and processing them later\nworkers can process one or multiple queues\nworkers can be run on different servers\n
it was developed by the cool folks @github, it was inspired by delayedjob\nresque is written in ruby which is a redis backed library for creating background jobs, placing them in queues and processing them later\nworkers can process one or multiple queues\nworkers can be run on different servers\n
it was developed by the cool folks @github, it was inspired by delayedjob\nresque is written in ruby which is a redis backed library for creating background jobs, placing them in queues and processing them later\nworkers can process one or multiple queues\nworkers can be run on different servers\n
it was developed by the cool folks @github, it was inspired by delayedjob\nresque is written in ruby which is a redis backed library for creating background jobs, placing them in queues and processing them later\nworkers can process one or multiple queues\nworkers can be run on different servers\n
it was developed by the cool folks @github, it was inspired by delayedjob\nresque is written in ruby which is a redis backed library for creating background jobs, placing them in queues and processing them later\nworkers can process one or multiple queues\nworkers can be run on different servers\n
resque supports prioritising jobs by prioritising queues against each other\njobs are persisted to queues as JSON objects and the queues are stored in redis as lists\na nice web interface, a sinatra app, is also included for monitoring the workers\nplugin system using a event framework for events like after_fork, before_fork etc \n
resque supports prioritising jobs by prioritising queues against each other\njobs are persisted to queues as JSON objects and the queues are stored in redis as lists\na nice web interface, a sinatra app, is also included for monitoring the workers\nplugin system using a event framework for events like after_fork, before_fork etc \n
resque supports prioritising jobs by prioritising queues against each other\njobs are persisted to queues as JSON objects and the queues are stored in redis as lists\na nice web interface, a sinatra app, is also included for monitoring the workers\nplugin system using a event framework for events like after_fork, before_fork etc \n
resque supports prioritising jobs by prioritising queues against each other\njobs are persisted to queues as JSON objects and the queues are stored in redis as lists\na nice web interface, a sinatra app, is also included for monitoring the workers\nplugin system using a event framework for events like after_fork, before_fork etc \n
resque supports prioritising jobs by prioritising queues against each other\njobs are persisted to queues as JSON objects and the queues are stored in redis as lists\na nice web interface, a sinatra app, is also included for monitoring the workers\nplugin system using a event framework for events like after_fork, before_fork etc \n
this is a little tangent, but i quickly want to talk about redis\nit’s a key-value store, all its operations are atomic and O(1) meaning they will always complete in a constant amount of time\nthis means speed and its really important when you want to set and forget\n\n
this is a little tangent, but i quickly want to talk about redis\nit’s a key-value store, all its operations are atomic and O(1) meaning they will always complete in a constant amount of time\nthis means speed and its really important when you want to set and forget\n\n
this is a little tangent, but i quickly want to talk about redis\nit’s a key-value store, all its operations are atomic and O(1) meaning they will always complete in a constant amount of time\nthis means speed and its really important when you want to set and forget\n\n
this is a little tangent, but i quickly want to talk about redis\nit’s a key-value store, all its operations are atomic and O(1) meaning they will always complete in a constant amount of time\nthis means speed and its really important when you want to set and forget\n\n
this is a little tangent, but i quickly want to talk about redis\nit’s a key-value store, all its operations are atomic and O(1) meaning they will always complete in a constant amount of time\nthis means speed and its really important when you want to set and forget\n\n
this is a little tangent, but i quickly want to talk about redis\nit’s a key-value store, all its operations are atomic and O(1) meaning they will always complete in a constant amount of time\nthis means speed and its really important when you want to set and forget\n\n
they use it for a whole host of things\n
they use it for a whole host of things\n
they use it for a whole host of things\n
they use it for a whole host of things\n
they use it for a whole host of things\n
they use it for a whole host of things\n
around 2009 when they released this library they had already processed over 10 million jobs\nwow … right\n
around 2009 when they released this library they had already processed over 10 million jobs\nwow … right\n
so, how does it do what it does ?\nas a user of the resque library in your app you essentially interact with redis\nwhen you ask resque to queue up a job, it will push it onto the queue in redis\na resque worker comes along at some point in time and pops a job of the queue and forks that into its own process and runs the job\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
but it can also have a setUp and tearDown method if there are pre and post actions you wish to do or conditions you wish to check etc\n