how do you add a constructor to a GearmanFunction?
Hello. Could you please explain how to add a constructor to my gearman function? I just want to simply add variables to my gearman function and initialize them when I instantiate the function however I can't seem to just extend AbstractGearman
Initially I create my function without a constructor and use the DefaultGearmanF
GearmanWorker worker = new GearmanWorkerIm
worker.
worker.
worker.work();
Now what I want to store data in my test function and tried to do it like so..
public class MyTestFunction extends AbstractGearman
String id;
public MyTestFunction() {
this(null);
}
public MyTestFunction(
this(name,"");
}
public MyTestFunction(
super(name);
this.id = id;
}
@Override
public GearmanJobResult executeFunction() {
System.
new byte[0], new byte[0], 0, 0);
return gjr;
}
}
However this doesn't work and it also doesn't seem correct. Could you please help?
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Khai Do
- Solved:
- Last query:
- Last reply: