Weave 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

Cloud Tasks Laravel Package

google/cloud-tasks

Official Google Cloud Tasks client library for PHP. Create and manage queues, dispatch asynchronous HTTP and App Engine tasks, configure retries and scheduling, and integrate with Google Cloud IAM and authentication through the Google Cloud PHP SDK.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit — This is a generated GAPIC client for Google Cloud Tasks, not a Laravel package. There is no service provider, no publishable config, no facade, and no queue driver. Architecturally, Cloud Tasks is a push model: you enqueue an HTTP request with a payload, and Google delivers it to a target URL under a retry/rate policy. Laravel's queue contract is pull (pop/reserve/delete), so this does not slot into config/queue.php as a driver. The realistic fit is twofold:

  1. A scheduler/dispatcher for delayed or externally-paced HTTP work (webhook fan-out, third-party API calls under strict rate limits, timed reminders), where the Laravel app exposes an authenticated internal endpoint that receives the task and dispatches a normal Laravel job.
  2. A rate-limited egress gateway — maxDispatchesPerSecond, maxConcurrentDispatches, and maxBurstSize are queue-level controls that are materially better than what Laravel workers give you against a fragile upstream API.

Integration feasibility — Feasible but requires a deliberate adapter. Costs to budget:

  • Auth: service account JSON or Workload Identity Federation; ADC resolution and token caching are handled by google/auth, but env/secret handling is yours.
  • Transport: gRPC (ext-grpc) or REST fallback. REST is the low-friction path for standard PHP-FPM/Cloud Run images; gRPC needs a build-time extension.
  • Network path: Cloud Tasks must reach your handler over public HTTPS with a valid cert. If the Laravel app is on-prem or firewalled, you need a bridge (Cloud Run front door, or private VPC egress configuration). This is the single most common reason this integration stalls.
  • Payload limits: ~100KB body for HTTP targets. Pass an ID and rehydrate from the DB; do not serialize large jobs.

Technical risk

  • At-least-once delivery — duplicate tasks are normal. Handlers must be idempotent with an explicit dedup key; ShouldBeUnique on Redis does not cover the Cloud Tasks → endpoint hop.
  • No dead-letter queue — retries exhaust and the task is silently dropped. Dead-letter semantics, alerting, and replay tooling are entirely your build.
  • No official emulator parity — local and CI testing needs an interface + fake, not the real client.
  • Generated-code churn — minor releases track proto changes; type signatures shift. Pin and test upgrades rather than floating.
  • Misleading health signals — 21 stars and 0 dependents reflect a monorepo split package (the real repo is googleapis/google-cloud-php). Do not read this as abandonment; conversely, do not read the automated release cadence as Laravel-specific support. Both the stars and the release date should be discounted as adoption evidence.

Key questions — Where does the Laravel app actually run, and is it reachable by Google over public HTTPS? Is ext-grpc viable in our image, or do we standardize on REST? Who owns idempotency keys and the dead-letter/replay path? Are we already running Horizon/Redis, and are we willing to split async concerns across two systems? Which workload goes first — scheduled reminders or rate-limited third-party egress? What is our service-account-per-environment model?

Integration Approach

Stack fit — Treat Cloud Tasks as infrastructure adjacent to Laravel, not inside it. Build a thin CloudTasksDispatcher interface (~200–400 LOC) with: enqueue(string $handler, array $payload, ?DateTimeInterface $scheduleAt, array $headers), a queue-name map per environment, and a FakeDispatcher for tests. Bind it in a service provider; keep the generated client behind it so a future swap to SQS or EventBridge is a single implementation change. On the receiving side, one signed, idempotent controller endpoint that validates the task header/OIDC token, records the attempt, and dispatches a conventional Laravel job.

Migration path — Do not attempt to replace the existing queue driver. Coexist: keep database/Redis + Horizon for CPU-bound and transactional work; route only genuinely scheduled or externally-paced work to Cloud Tasks. Migrate one workflow at a time, behind a config flag, with the old path retained for a release cycle so you can dual-run and compare.

Compatibility — Pin the package to a minor version, run composer update --dry-run in CI, and require ext-grpc or ext-json+REST explicitly in composer.json. Support matrix should cover PHP 8.2+ and the Laravel versions in use; there is no framework coupling to break, which is the package's main compatibility virtue.

Sequencing — (1) Stand up the dispatcher abstraction + fake and land it with no callers. (2) Prove the network path and auth in staging with a no-op handler. (3) Migrate one low-blast-radius workflow (e.g., outbound webhooks). (4) Harden idempotency, dead-letter logging, and alerting. (5) Add rate-limited egress. (6) Only then consider scheduled reminders or anything user-facing. Rough order of magnitude: one to two sprints for the first production slice including the observability work.

Operational Impact

Maintenance — Low ongoing code maintenance: releases are automated from the upstream monorepo, Apache-2.0, no transitive framework dependencies. The maintenance burden is not the library — it is the idempotency, dead-letter, and replay machinery you must own. Budget recurring time for dependency bumps and for GCP-side queue configuration drift (retry policy and rate limits changed by hand in console).

Support — Split ownership is the risk. Google Cloud Support covers the Cloud Tasks service; the PHP library is GitHub issues from a generated-code team with no Laravel context. Internal escalation should route to the platform/cloud team, not the framework team. Ramp-up for a mid-level Laravel engineer is real: IAM/service accounts, queue semantics, push-vs-pull mental model, and scheduleTime/retention constraints — call it one to two weeks to productive, not days.

Scaling — Strong. Queue-level throttles protect upstreams better than anything native to Laravel; tasks can be scheduled up to ~30 days out with 31-day retention. Throughput ceilings are quota-bound, not library-bound, and are raised via GCP quota requests. The main scaling hazard is recovery behavior: if the handler is down, tasks accumulate and then arrive in a burst — maxDispatchesPerSecond is your thundering-herd control, so set it deliberately rather than leaving defaults.

Failure modes to instrument from day one:

  • Handler non-2xx or timeout → retry; after maxAttempts the task is dropped with no DLQ. Alert on tasks reaching high attempt counts and on attemptDispatchCount distributions.
  • Duplicate delivery → double-charged side effects. Dedup table with TTL is mandatory for anything financial or notification-bearing.
  • Endpoint unreachable (cert expiry, ingress change, cold start > dispatch deadline) → silent backlog. Alert on queue depth and oldest-task age.
  • Poison payload (unparseable, oversized) → burns retries, never succeeds. Validate before enqueue, not after.
  • Cross-system traceability gap → no native Laravel tracing. Propagate a correlation ID and the task name in headers and log both sides, or debugging a failed send becomes guesswork.

Ramp-up — Plan for a short internal design doc and one brown-bag session covering the push model, idempotency expectations, and the "no DLQ" reality. That single hour is the difference between a clean adoption and a quarter of duplicate-email incidents.

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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings