Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
mikespook fe5a31a51e fixed resources leaking 11 лет назад
client using time.After instead of a separate goroutine 12 лет назад
common replace the covertion method 12 лет назад
example fixed resources leaking 11 лет назад
worker fixed resources leaking 11 лет назад
.hgtags Added tag 0.1.1 for changeset eea0878b43d2 12 лет назад
LICENSE Added the client 13 лет назад
README.md fixed resources leaking 11 лет назад
gearman.go fixing for 'go install' 12 лет назад

README.md

Gearman API for golang

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 bitbucket.org/mikespook/gearman-go/client

Install the worker package:

$ go get bitbucket.org/mikespook/gearman-go/worker

Install both:

$ go get bitbucket.org/mikespook/gearman-go

SAMPLE OF 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)
// ...

Contacts

Xing Xing mikespook@gmail.com

Blog

@Twitter

History

  • 0.1.2 Fixed issues: timeout executing, resources leaking.
  • 0.1.1 Fixed the issue of grabbing jobs.
  • 0.1 Code refactoring; Redesign the API.
  • 0.0.1 Initial implementation, ugly code-style, slow profermance and unstable API.

TODO