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

  • SEARCH
  • Home
  • 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 9206371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:09:40+00:00 2026-06-18T00:09:40+00:00

Given this line of code to callback a function and the callback function itself:

  • 0

Given this line of code to callback a function and the callback function itself:

Class MyClass {
    public function doThings() {
        $this->gearman->client->setCompleteCallback("workerCompleted");
    }

    public function workerCompleted() {
        echo "worker is completed!";
    }
}

I get Message: GearmanClient::setCompleteCallback(): function workerCompleted is not callable

The setCompleteCallback method expects a function name in quotations, but how do I call a class method? $this->"workerCompleted" obviously is wrong.

  • 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-18T00:09:42+00:00Added an answer on June 18, 2026 at 12:09 am
    $this->gearman->client->setCompleteCallback("workerCompleted");
    

    should be

    $this->gearman->client->setCompleteCallback( array( $this, "workerCompleted"));
    

    Because you’re specifying a callback to a member function, which requires an array of the object (or classname) that needs to be called, along with the name of the function. More info at the docs.

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

Sidebar

Related Questions

Given this code: bob = setInterval(function, 1000); clearInterval(bob); Is there now a way to
Given this code: wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = wifi.getConnectionInfo(); ...and this line
given this javascript code: this.underlyingReference = {name: 'joe'}; this.nullMe(this.underlyingReference); alert(this.underlyingReference.name); function nullMe(variable) { variable
Given this line of code in C: printf(%3.0f\t%6.1f\n, fahr, ( (5.0/9.0) * (fahr-32) )
Could someone explain why this line of code isn't working. No errors are given.
Given this CSS body { font-size: 62.5%; font-family: Arial,sans-serif; line-height: 2em; color:#333 } .post_text
Given I have a long phrase, say, in line :12 , as this example:
ok I give up, how do you do this in one line? public object
I can't run this function. It gives the error: ERROR at line 9: PL/SQL:
Given this code: List<Integer> ints = new ArrayList<Integer>(); // Type mismatch: // cannot convert

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.