laravel-aws-worker icon indicating copy to clipboard operation
laravel-aws-worker copied to clipboard

Advantages of processing using laravel jobs

Open aluferraz opened this issue 7 years ago • 1 comments

Hi,

I'm a little bit confused.. The advantage of using this package is that we can schedule and retrieve the jobs in a "laravel standard" way?

Currently I've created some POST routes, available only in the worker environment and they process all the time consuming tasks directlly, returning 200 if all went fine.

Example:

if(isWebEnvironment){ $app->post('/email', function(){ .... $client->sendMessage(array( 'QueueUrl' => $queueUrl, 'MessageBody' => 'An awesome message!', )); }); } if(isWorkerEnvironment){ $app->post('/sqs', function(){ ... "send email".. }); }

So, the web environment push a message to the SQS and the SQS itself post that message to the worker environment.. Using this package will lead to a better performance ? Or the goal is just to use the standard laravel queue pushing-pulling.. ?

Thanks in advance !

aluferraz avatar Mar 04 '17 16:03 aluferraz

It's advantageous because you're only using CPU compute time to process a job when one exists, instead of constantly pulling.

t202wes avatar Apr 09 '18 22:04 t202wes