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

Gearman Laravel Package

enqueue/gearman

Gearman transport for Enqueue: send and consume queue messages via a Gearman broker using Enqueue’s queue specification. Part of the php-enqueue ecosystem with docs, support chat, and CI-tested releases.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Decentralized Job Processing: Enables horizontal scaling of background jobs by leveraging Gearman’s distributed task queue architecture, ideal for Laravel applications where synchronous processing is a bottleneck. Supports microservices or high-traffic systems needing async workflows.
  • Legacy System Integration: Facilitates integration with existing Gearman-based workflows (e.g., legacy PHP systems) without rewriting job queues, reducing migration costs and technical debt.
  • Roadmap for Async Features: Provides a lightweight, protocol-agnostic foundation for future queue backends (e.g., Redis, RabbitMQ) via Enqueue’s abstraction layer, aligning with Laravel’s evolving async capabilities.
  • Build vs. Buy: Avoids reinventing a Gearman client for Laravel, saving development time while adhering to Enqueue’s standardized interface. Low maintenance activity signals caution but aligns with niche use cases (e.g., legacy Gearman infrastructure).
  • Use Cases:
    • Batch Processing: Image resizing, report generation, or data transformations requiring offloaded CPU-intensive tasks.
    • Decoupled Workflows: Long-running tasks (e.g., PDF generation, API integrations) that must not block user requests.
    • Hybrid Architectures: Systems where Gearman workers already exist, and Laravel needs to participate in the queue ecosystem without full rewrite.
    • Cost-Effective Scaling: Leverages existing Gearman infrastructure to avoid over-provisioning Laravel’s built-in queue workers.

When to Consider This Package

  • Adopt if:
    • Your infrastructure already uses Gearman (e.g., existing workers, deployed gearmand servers), and you want to integrate Laravel without rewriting the queue layer.
    • You need a simple, MIT-licensed queue transport with minimal dependencies, prioritizing protocol flexibility over modern features.
    • Your team is evaluating Enqueue as a queue abstraction layer and requires Gearman support for backward compatibility.
    • Your use case involves low-to-moderate job volume where Gearman’s simplicity is sufficient (e.g., internal tools, batch jobs).
    • You’re willing to accept limited maintenance (last release: 2017) and plan for potential forks or alternative transports (e.g., Redis) in the future.
  • Look elsewhere if:
    • You need active maintenance, bug fixes, or security updates. Consider Enqueue’s Redis transport or Laravel’s built-in queue workers.
    • Your use case requires advanced queue features (e.g., job retries, delayed execution, priority queues, or monitoring). Gearman’s simplicity may not suffice.
    • You’re constrained by performance (Gearman adds network overhead compared to in-memory backends like Redis or database queues).
    • Your team lacks Gearman expertise, as setup/configuration may require additional effort (e.g., deploying workers, tuning Gearman servers).
    • You’re building a greenfield project without existing Gearman infrastructure, where modern alternatives (e.g., RabbitMQ, AWS SQS) offer better tooling and scalability.

How to Pitch It (Stakeholders)

For Executives: "This package allows us to offload CPU-heavy or time-consuming tasks—like video processing, report generation, or API integrations—from our Laravel application to a distributed Gearman worker pool. By doing so, we improve response times for users while leveraging our existing Gearman infrastructure, reducing the need for additional hardware or services. It’s a lightweight, MIT-licensed solution that integrates seamlessly with Laravel via the Enqueue library, making it ideal for scenarios where we’re already invested in Gearman or need a simple queue abstraction. The trade-off is minimal maintenance risk (last updated in 2017), but the cost of building this in-house would outweigh the benefits for our current scale. This aligns with our goals to optimize performance and reduce technical debt in our async workflows."

For Engineering (Technical Leaders): *"The enqueue/gearman package provides a Laravel-compatible Gearman client through Enqueue’s queue abstraction layer. Here’s why it’s valuable:

  • Zero Reinvention: Uses Enqueue’s standardized API (Connection, Context) for consistency with other transports (e.g., Redis, RabbitMQ), reducing vendor lock-in.
  • Protocol Flexibility: Swap Gearman for another backend later without rewriting job logic, future-proofing our architecture.
  • Lightweight Integration: Minimal dependencies; just a bridge to Gearman’s RPC model, with no heavy framework overhead. Caveats:
  • No Active Maintenance: Last release was in 2017, so we’d need to monitor compatibility with newer Enqueue versions or plan for forks.
  • Limited Features: Lacks advanced queue capabilities (e.g., retries, delayed jobs, monitoring), so we’d need to implement these at the application level.
  • Best for Legacy Systems: Ideal for integrating with existing Gearman workers or proof-of-concept projects. For production, pair with a more maintained transport (e.g., Redis) or budget for custom maintenance."*

For Developers: *"This is a drop-in Gearman transport for Enqueue that lets you dispatch Laravel jobs to a Gearman queue. Here’s how to use it:

  1. Install the package:
    composer require enqueue/gearman enqueue/laravel
    
  2. Configure Laravel’s queue: Update config/queue.php to include a Gearman connection:
    'connections' => [
        'gearman' => [
            'driver' => 'enqueue',
            'transport' => 'gearman',
            'host' => env('GEARMAN_HOST', '127.0.0.1'),
            'port' => env('GEARMAN_PORT', 4730),
        ],
    ],
    
  3. Dispatch jobs:
    dispatch(new ProcessVideoJob)->onConnection('gearman');
    
  4. Run workers: Deploy a Gearman worker (e.g., via Docker or a PHP script) to consume jobs. Example worker setup:
    $context = new \Enqueue\Client\Context();
    $consumer = new \Enqueue\Gearman\Consumer($context, ['host' => 'gearman']);
    $consumer->setJobHandler(new class implements \Enqueue\Client\JobHandler {
        public function handle(\Enqueue\Client\Job $job) {
            // Process job payload
        }
    });
    $consumer->run();
    

Pro Tips:

  • Use Enqueue’s ConnectionFactory to dynamically switch transports.
  • Gearman lacks built-in retry logic, so implement retries in your job handler or use Laravel’s retryAfter().
  • Monitor Gearman worker health separately, as this package doesn’t include native observability tools. Warning: This package is unmaintained, so test thoroughly and consider forking or migrating to a supported transport (e.g., Redis) if Gearman becomes a bottleneck."*
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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor