|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59848 Server-side callbacks not working for background tasks
Submitted: 2011-07-13 12:10 UTC Modified: 2011-07-14 00:03 UTC
From: dev at bottomlessinc dot com Assigned: hradtke (profile)
Status: Wont fix Package: gearman (PECL)
PHP Version: 5.3.3 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-07-13 12:10 UTC] dev at bottomlessinc dot com
Client doesn't receive data/status from workers when jobs 
are run in 
the background.

This was already mentioned by Rasmus back in 2009:

"I only use non-blocking background tasks and it currently 
possible to use this data passing mechanism from a 
background task. 
Right now if you call $job->data() from a background worker, 
data is simply dropped."

(see the 2 last paragraphs)

What's the status?

Is the problem with the Gearman server? or only the Pecl 

Reproduce code:
On the client:

Register callbacks:

Add bg tasks:

On the Worker:

Expected result:
When the worker calls sendData/sendStatus, the corresponding 
registered callbacks on the Client should be called

Actual result:
Callbacks not called, data dropped.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-14 00:03 UTC]
Once a client sends a background task, the client is no longer registered as listening on the gearman daemon. When the worker sends the data back, it goes to the daemon, the daemon concludes no one is listening and drops the data.

When PHP makes an asynchronous request, it fires and forgets. It does not work like JavaScript.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Oct 01 02:01:25 2023 UTC