demisang / php-gearman Goto Github PK
View Code? Open in Web Editor NEWGearman job server workers helper
License: GNU General Public License v3.0
Gearman job server workers helper
License: GNU General Public License v3.0
Warning: Ambiguous class resolution, "demi\gearman\laravel5\Console\SupervisorCommand" was found in both "./vendor/demi/php-gearman/laravel5/console/SupervisorCommand.php" and "./vendor/demi/php-gearman/laravel5/Console/SupervisorCommand.php", the first will be used.
Illuminate\Foundation\ComposerScripts::postAutoloadDump
@php artisan package:discover
In GearmanServiceProvider.php line 34:
Call to undefined method Illuminate\Foundation\Application::share()
I am getting in Class 'GearmanClient' not found GearmanQueue.php (line 99).
Is i have to install extra thing?
Hi,
I'm using Gearman to do some processing in background, but I need the results when finished. From documentation of PHP for Gearman, and your implementation I see that there is a part where I should wait for results while($worker->work()) {}
. However I'm not able to get the results. This is what I have:
$r = [];
$r['status'] = false;
$tmp = [];
$chunkedData = array_chunk($originalData, (int)(ceil(count($originalData) / 5)));
for($i = 0; $i < count($chunkedData ); $i++) {
$r = Gearman::doHighBackground('parse_data', ['data' => $chunkedData [$i]]);
// how to wait for $r['data'] ?
array_push($tmp, $r['data']);
}
and my Laravel command handle()
method :
public function handle()
{
Gearman::runWorker('parse_data', function(GearmanJob $job) {
$this->line('<fg=yellow;>Started parsing data..</>');
$data = Gearman::deserializeWorkload($job->workload());
$data= $data['data'];
$res = $this->processData($data);
$data = array_values(array_map("unserialize",
array_unique(array_map("serialize", $res))));
$this->line('<fg=yellow;>Parsing finished.</>');
return Gearman::serializeWorkload(['status' => true, 'data' => $data]);
});
}
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.