dusterio / laravel-aws-worker

Run Laravel (or Lumen) tasks and queue listeners inside of AWS Elastic Beanstalk workers
MIT License
311 stars 59 forks source link

Advantages of processing using laravel jobs #11

Closed aluferraz closed 1 year ago

aluferraz commented 7 years ago

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 !

t202wes commented 6 years ago

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