Repository navigation
Closed
Labels
kind/extensionIssues related to extensionsIssues related to extensionsnew featureNew feature or requestNew feature or request
Milestone
Description
Hi,
it would be nice to add the gearman extension: https://pecl.php.net/package/gearman
For Linux, I was able to successfully test it with FrankenPHP
FROM dunglas/frankenphp:latest-php8.3
RUN apt-get update && apt-get install -y \
libgearman-dev \
&& rm -rf /var/lib/apt/lists/*
RUN pecl install gearman \
&& docker-php-ext-enable gearmanRun the Container
docker run --rm -it --add-host=host.docker.internal:host-gateway -v /root/StatusengineOcspProcessor.php:/root/StatusengineOcspProcessor.php my-frankenphp-gearman bash
This is my PHP Gearman Test Code:
<?php
print_r(get_loaded_extensions());
$StatusengineOcsp = new StatusengineOcspProcessor();
$StatusengineOcsp->loop();
//Example Class
class StatusengineOcspProcessor{
/**
* @var \GearmanWorker
*/
private $GearmanWorker;
public function __construct(){
$GearmanClient = new \GearmanClient();
$GearmanClient->addServer('host.docker.internal', 4730);
$GearmanClient->doBackground('statusngin_ocsp', json_encode(['test' => 'data']));
//Create the GearmanWorker PHP Object
$this->GearmanWorker = new \GearmanWorker();
//Connect to the Gearman-Job-Server
$this->GearmanWorker->addServer('host.docker.internal', 4730);
//Consume data from the queue statusngin_ocsp and pass it
//to the php method handleOcsp of the this class
$this->GearmanWorker->addFunction('statusngin_ocsp', [$this, 'handleOcsp']);
}
public function loop(){
//Start infinite loop to consume incoming jobs
while(true){
$this->GearmanWorker->work();
}
}
public function handleOcsp($job){
//Print service check data to stdout
print_r(json_decode($job->workload()));
}
}You should get the output
stdClass Object
(
[test] => data
)
Metadata
Metadata
Assignees
Labels
kind/extensionIssues related to extensionsIssues related to extensionsnew featureNew feature or requestNew feature or request
Activity
henderkes commentedon May 6, 2026
Oh boy. gearman relies on boost. Enjoy the 2 hour build times.
henderkes commentedon May 6, 2026
Thankfully it's only the programs requiring it, we can build just the library
henderkes commentedon May 6, 2026
will be closed by #980 when v3 alpha releases
nook24 commentedon May 6, 2026
Many thanks for your fast solution!