Closed georgeboot closed 3 years ago
@mnapoli mind shining some light on this?
Thanks, that sounds like an interesting direction and I generally agree this is something worth exploring.
However this PR cannot be merged: it refactors too much stuff without explanations, and more importantly it contains copyrighted code copied without attribution which violates the license of the original code.
I'm going to close this PR, but I am not against going this route.
See #31
Fixes #14 Fixes #22
Change 1: Store job attempt in job payload
ApproximateReceiveCount
should not be used when processing SQS jobs in Lambda. See https://link.medium.com/uUkT2W9bTbb for more info. This PR adds functionality to store the current attempt on the job payload, so we don't have to depend onApproximateReceiveCount
.One downside of this, is that because we can't update sqs messages, we always have to re-create a message when releasing it back onto the queue.
Change 2: Refactor workers
This now uses the built-in worker to process jobs. This is more in line with how Laravel processes jobs for other drivers.
The code is 'backwards compatible' in the sense that the example
worker.php
remains identical. If you did not change that, all should continue working as usual.The code is heavily inspired (and sometimes copied) from https://github.com/laravel/vapor-core/