Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8062079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:32:54+00:00 2026-06-05T10:32:54+00:00

I am working on a Gearman client-worker script. Can we declare the Gearman callbacks

  • 0

I am working on a Gearman client-worker script. Can we declare the Gearman callbacks methods as protected or private? i.e.

$this->gearmanClient->setCompleteCallback(array($this, 'JobComplete'));
$this->gearmanClient->setFailCallback(array($this, 'JobFailCallBack'));

What is best access operator to be used with the ‘JobComplete’ methods etc?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:32:56+00:00Added an answer on June 5, 2026 at 10:32 am

    In PHP, private / protected callbacks are only accesible if called from the right context (e.g. within the class that has access to those callbacks) – see here for discussion.

    In your case, the GearmanClient class will not have access to the callback (unless you do some really weird abstractions around it). So the answer is no, you cannot.

    As for the access operator question (if I understand correctly – whether to use object callbacks or class callbacks), I guess the answer is – it depends. If your callback will provide data about a particular object, then it makes sense for that object to receive the callback. If it’s a generic message that your app will just store in DB, a static class interface can do that, too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on an irc client in Adobe AIR in JavaScript, and thinking about logging.
I have an application, which works with Resources for translation. This is working great.
I'm using Ubuntu Natty with PHP 5.3.8. I just got Gearman working on my
I've got a post-commit hook script that performs a SVN update of a working
I want to be able to have a PHP script working in the background.
I am working in internationalization. Can anybody help me how to set up for
My python script is working now, but I'm having a little trouble: Here is
I've got a German VisualStudio 9.0. Working with doubles and doing quite some parsing,
The application that I'm working on supports 3 languages: English, French and German. How
Working on a bunch of forms at the moment and I'm finding that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.