spatie/laravel-long-running-tasks
Monitor and manage external long-running tasks (e.g., AWS Rekognition jobs) in Laravel by polling for status. Define a task with a check() method, store metadata, and keep checking at a configurable interval until completion.
LongRunningTaskLogItem model, critical for auditing and troubleshooting long-running operations.StandardBackoffCheckStrategy), reducing API throttling risks and improving resilience.Use This Package When:
Look Elsewhere If:
queue:work + webhook listeners instead).*"This package lets us handle slow, external API calls (like AWS Rekognition or video processing) without blocking users or servers. Instead of waiting 30+ seconds for a response, we offload the work to a background job that polls the API every 10 seconds (configurable) until it’s done. It’s like setting a timer for a coffee machine—you don’t have to stand there watching it. We get:
*"This solves a common pain point: how to handle long-running external API calls in Laravel without timeouts or blocking. Here’s why it’s a no-brainer:
check() method in your task class—return TaskResult::ContinueChecking to keep polling, TaskResult::StopChecking to finish. Done.default, custom queues, or even Horizon). No need to reinvent the wheel.StandardBackoffCheckStrategy starts at 10s, then 60s, 120s, etc.).LongRunningTaskLogItem record with status, exceptions, and run history. Debugging is trivial.meta or override the job).
Trade-offs:Call to Action: "Let’s prototype this for [specific use case, e.g., ‘AWS Rekognition image analysis’] in 2 hours. I’ll provide a spike PR with a sample task class and queue setup."
How can I help you explore Laravel packages today?