選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
mikespook d6c6bfe9f0 moved to github 11年前
client moved to github 11年前
common merge 11年前
example moved to github 11年前
worker moved to github 11年前
.gitignore Initial commit 11年前
.hgtags Added tag 0.1.2 for changeset 67f11fa2301f 11年前
LICENSE Added the client 13年前
README.md moved to github 11年前
gearman.go moved to github 11年前

README.md

Gearman-Go

This package is a Gearman API for Golang. It was implemented a native protocol for both worker and client API.

Copyright 2012 Xing Xing mikespook@gmail.com All rights reserved. Use of this source code is governed by a MIT license that can be found in the LICENSE file.

Install

Install the client package:

$ go get github.com/mikespook/gearman-go/client

Install the worker package:

$ go get github.com/mikespook/gearman-go/worker

Install both:

$ go get github.com/mikespook/gearman-go

Usage

Worker

w := worker.New(worker.Unlimited)
w.ErrHandler = func(e error) {
    log.Println(e)
}
w.AddServer("127.0.0.1:4730")
w.AddFunc("ToUpper", ToUpper, worker.Immediately)
w.AddFunc("ToUpperTimeOut5", ToUpper, 5)
w.Work()

Client

c, err := client.New("127.0.0.1:4730")
// ...
defer c.Close()
echo := []byte("Hello\x00 world")
c.JobHandler = func(job *client.Job) error {
    log.Printf("%s", job.Data)
    return nil
}
c.ErrHandler = func(e error) {
    log.Println(e)
    panic(e)
}
handle, err := c.Do("ToUpper", echo, client.JOB_NORMAL)
// ...

Authors

Xing Xing mikespook@gmail.com Blog @Twitter

Open Source - MIT Software License

Copyright (c) 2012 Xing Xing

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.