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.
gearmand servers), and you want to integrate Laravel without rewriting the queue layer.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:
Connection, Context) for consistency with other transports (e.g., Redis, RabbitMQ), reducing vendor lock-in.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:
composer require enqueue/gearman enqueue/laravel
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),
],
],
dispatch(new ProcessVideoJob)->onConnection('gearman');
$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:
ConnectionFactory to dynamically switch transports.retryAfter().How can I help you explore Laravel packages today?