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 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

Product Decisions This Supports

  • Asynchronous Processing for External APIs: Enables polling-based workflows for services (e.g., AWS Rekognition, video encoding, or batch processing APIs) that lack webhook support. Reduces latency by offloading blocking calls to background jobs.
  • Build vs. Buy: Avoids reinventing polling logic, queues, and state management. Leverages Spatie’s battle-tested Laravel integration (e.g., queues, migrations, config) to accelerate development.
  • Observability & Debugging: Provides built-in task tracking (status, exceptions, run history) via the LongRunningTaskLogItem model, critical for auditing and troubleshooting long-running operations.
  • Scalable Backoff Strategies: Supports exponential/linear backoff for retries (e.g., StandardBackoffCheckStrategy), reducing API throttling risks and improving resilience.
  • Roadmap for Event-Driven Architectures: Future-proofs integration with Laravel’s event system (e.g., triggering notifications when tasks complete/fail) or extending to support webhooks later.

When to Consider This Package

  • Use This Package When:

    • Your Laravel app interacts with external APIs that require polling (no webhooks).
    • Tasks exceed HTTP timeout limits (e.g., >30 seconds) or block the request thread.
    • You need reliable retries with backoff for transient failures (e.g., rate limits).
    • You want built-in logging/auditing for long-running operations without custom code.
    • Your team lacks expertise in queue workers or asynchronous task design.
  • Look Elsewhere If:

    • The external service supports webhooks (use Laravel’s queue:work + webhook listeners instead).
    • Tasks are truly fire-and-forget (e.g., one-off cron jobs) with no need for polling.
    • You’re using a non-Laravel stack (e.g., Node.js, Python) or need multi-language support.
    • You require distributed task coordination (e.g., Kubernetes jobs, Celery) beyond Laravel’s queue system.
    • Your use case involves human-in-the-loop workflows (consider Laravel Nova actions or custom UI).

How to Pitch It (Stakeholders)

For Executives:

*"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:

  • Faster responses for users (no timeouts).
  • Automatic retries with smart backoff to avoid API bans.
  • Full visibility into task statuses (e.g., ‘pending,’ ‘failed’) for support teams.
  • Zero custom infrastructure—it’s a drop-in Laravel package with built-in queues and logging. Cost: Minimal (MIT license, open-source). Risk: Low (Spatie is a trusted Laravel vendor with 300K+ downloads across packages)."*

For Engineering:

*"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:

  • Polling Made Easy: Define a check() method in your task class—return TaskResult::ContinueChecking to keep polling, TaskResult::StopChecking to finish. Done.
  • Queue Integration: Uses Laravel’s queues (supports default, custom queues, or even Horizon). No need to reinvent the wheel.
  • Backoff Strategies: Built-in exponential/linear backoff to handle rate limits (e.g., StandardBackoffCheckStrategy starts at 10s, then 60s, 120s, etc.).
  • Observability: Every task gets a LongRunningTaskLogItem record with status, exceptions, and run history. Debugging is trivial.
  • Extensible: Swap out the default model/job for custom logic (e.g., add fields to meta or override the job). Trade-offs:
  • Adds a ~5-minute setup (migrations, config, queue worker).
  • Not for real-time systems (tasks run every 10s+ by default). Alternatives: Writing custom queue jobs + polling logic would take 2–3x longer. This is production-ready with 38 GitHub stars and MIT license."*

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."

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