brefphp / laravel-bridge

Package to use Laravel on AWS Lambda with Bref
https://bref.sh/docs/frameworks/laravel.html
MIT License
314 stars 63 forks source link

How to run jobs in a redis connection queue? #53

Closed gregorip02 closed 2 years ago

gregorip02 commented 2 years ago

I am currently using ElastiCache with redis as the driver for the queues.

Based on your example posted at https://github.com/brefphp/examples/blob/master/Laravel/queues/worker.php I see that only one LaravelSqsHandler class is available, I am wondering if it is possible to process the jobs using LaravelRedisHandler or something like that.

deleugpn commented 2 years ago

That won't be "serverless" as you'll need a worker running 24/7 constantly hitting redis to see if there are available jobs. AWS Lambda isn't a good fit for this. What makes SQS natively supported is the fact that AWS provides a way to attach SQS to Lambda so that Lambda gets triggered automatically everytime a new message arrives.

gregorip02 commented 2 years ago

Oh, I didn't know about native SQS support with lambda. In this case I will try to change my driver to SQS but I am afraid that I will have problems due to the short delay times.

Thanks