php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62505 php setCompleteCallback not working
Submitted: 2012-07-08 01:24 UTC Modified: 2017-01-10 08:22 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: hradtke@php.net Assigned:
Status: Suspended Package: gearman (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
27 + 32 = ?
Subscribe to this entry?

 
 [2012-07-08 01:24 UTC] hradtke@php.net
Description:
------------
Posting this so it ends up in the archive where others might find it ....  if 
your setCompleteCallback is not working this may be why.



I spent several hours friday trying to debug code that used to work and stopped 
when we updated the libgearman php library.  What I eventually found is that 
with extension 0.8.1 and libgearman 33 the setCompleteCallback() MUST happen 
*before * calling addTask().    This doesn't appear to have been the case with 
earlier libgearman versions



What we had was



$gmclient->addTask('foo','bar');

$gmclient->setCompleteCallback('foodone');

$gmclient->runTasks();



That does not work - however this does.



$gmclient->setCompleteCallback('foodone');

$gmclient->addTask('foo','bar');

$gmclient->runTasks();



Not helped by having an old version of libgearman on my dev box where it did 
work.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-04 15:43 UTC] gearman at mailinator dot com
setCompleteCallback() only works with addTask and not with doNormal, doBackground, 
addBackgroundTasks.


Perhaps this should be noted in the documentation
 [2017-01-10 08:22 UTC] kalle@php.net
-Status: Open +Status: Suspended
 [2017-01-10 08:22 UTC] kalle@php.net
The gearman extension have not had much activity in the past few years, so I'm taking the safe bet that this is no longer under active development (as I don't consider the typo fixes on the github repo an active development), besides that it also targets unsupported PHP versions. Please unsuspend this report in case it begins to blossom with life once more
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 17:01:29 2024 UTC