We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example code
package main import ( "github.com/mikespook/gearman-go/worker" "log" ) func ToUpper(job worker.Job) ([]byte, error) { log.Printf("ToUpper: Data=[%s]\n", job.Data()) job.SendData(job.Data()) job.UpdateStatus(1, 1) return nil, nil } func main() { log.Println("Starting ...") defer log.Println("Shutdown complete!") w := worker.New( worker.Unlimited ) defer w.Close() w.ErrorHandler = func(e error) { log.Fatal(e) return } w.JobHandler = func(job worker.Job) error { log.Printf("Data=%s\n", job.Data()) return nil } w.AddServer("tcp4", "127.0.0.1:4730") w.AddFunc("ToUpper", ToUpper, worker.Unlimited) if err := w.Ready(); err != nil { log.Fatal(err) return } w.Work() }
console:
2014/10/01 10:17:09 Starting ... 2014/10/01 10:17:12 ToUpper: Data=[hello world] 2014/10/01 10:17:12 EOF exit status 1
The text was updated successfully, but these errors were encountered:
Could you show me the version of gearmand and OS environment and the client code?
Sorry, something went wrong.
Hello.
CentOS 6.5 Final x86_64
Name: libgearman Arch: x86_64 Version: 1.1.8 Release: 2.el6
Name: gearmand Arch: x86_64 Version: 1.1.8 Release: 2.el6
No problems with php and python, problems only with this extention :(
Client code included to server code
func ToUpper(job worker.Job) ([]byte, error) { log.Printf("ToUpper: Data=[%s]\n", job.Data()) job.SendData(job.Data()) job.UpdateStatus(1, 1) return nil, nil }
this function used to process gearman data.
No branches or pull requests
Example code
console:
The text was updated successfully, but these errors were encountered: