Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Long Running Tasks

Laravel Long Running Tasks Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Monitor long running tasks in a Laravel app

Frequently asked questions about Laravel Long Running Tasks
How do I handle long-running AWS Rekognition tasks in Laravel without blocking HTTP requests?
Use the `LongRunningTask` class to poll Rekognition’s status endpoint asynchronously. Define a custom task class extending `LongRunningTask`, implement the `check()` method to evaluate task completion, and return `TaskResult::StopChecking` when done. The package handles retries and state management automatically.
What Laravel versions does this package support?
This package is officially supported for Laravel 9 and 10. It requires PHP 8.1+ and leverages Laravel’s native queue and event systems, so ensure your app meets those requirements before installation.
Can I customize the polling interval for external APIs with rate limits?
Yes, the default polling interval is 10 seconds but can be adjusted in the config file (`default_check_frequency_in_seconds`). For APIs with strict rate limits, reduce this value or implement throttling logic inside your `check()` method.
How do I handle failed tasks or API timeouts?
Failed tasks are logged and can be retried automatically. Use Laravel’s queue failure system (e.g., `failed_jobs` table) to debug issues. For critical failures, extend the package to dispatch notifications or move tasks to a dead-letter queue.
Does this package work with Redis or SQS queues?
Yes, the package is queue-agnostic and supports Laravel’s built-in queue drivers, including Redis and SQS. Configure your queue connection in Laravel’s `.env` file, and the package will use it seamlessly for task execution.
How can I monitor long-running task progress in production?
Integrate with Laravel Horizon for Redis-based queues to visualize task statuses, retries, and failures. For database queues, query the `long_running_task_log_items` table directly or build a custom dashboard using the task metadata stored there.
Is there a way to test this package without hitting real external APIs?
Yes, the package includes utilities for mocking external API responses. Use Laravel’s HTTP client mocking or create a fake `LongRunningTaskLogItem` in tests to simulate task states (e.g., pending, completed, or failed).
What happens if an external API returns inconsistent states (e.g., flaky responses)?
The package retries failed checks by default, but you can customize retry logic in your task class. For idempotent operations, ensure your `check()` method handles duplicate executions gracefully, such as by checking task metadata before processing.
Can I use this package for real-time updates instead of polling?
No, this package is designed for polling-based workflows. If your external service supports webhooks, consider using Laravel Echo or Pusher for real-time updates instead. Polling is only suitable for APIs that lack webhook support.
How do I scale this for high-volume task processing?
Scale by running multiple queue workers (e.g., `php artisan queue:work --daemon`) and using a robust queue driver like Redis or SQS. Monitor queue backlogs with Laravel Horizon, and consider implementing task batching or horizontal scaling for extreme loads.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai