moved to github
This commit is contained in:
parent
c3e789b516
commit
d6c6bfe9f0
32
README.md
32
README.md
@ -8,22 +8,24 @@ All rights reserved.
|
|||||||
Use of this source code is governed by a MIT license that can be found
|
Use of this source code is governed by a MIT license that can be found
|
||||||
in the LICENSE file.
|
in the LICENSE file.
|
||||||
|
|
||||||
# INSTALL
|
Install
|
||||||
|
=======
|
||||||
|
|
||||||
Install the client package:
|
Install the client package:
|
||||||
|
|
||||||
> $ go get bitbucket.org/mikespook/gearman-go/client
|
> $ go get github.com/mikespook/gearman-go/client
|
||||||
|
|
||||||
Install the worker package:
|
Install the worker package:
|
||||||
|
|
||||||
> $ go get bitbucket.org/mikespook/gearman-go/worker
|
> $ go get github.com/mikespook/gearman-go/worker
|
||||||
|
|
||||||
Install both:
|
Install both:
|
||||||
|
|
||||||
> $ go get bitbucket.org/mikespook/gearman-go
|
> $ go get github.com/mikespook/gearman-go
|
||||||
|
|
||||||
|
|
||||||
# SAMPLE OF USAGE
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
## Worker
|
## Worker
|
||||||
|
|
||||||
@ -53,19 +55,17 @@ Install both:
|
|||||||
handle, err := c.Do("ToUpper", echo, client.JOB_NORMAL)
|
handle, err := c.Do("ToUpper", echo, client.JOB_NORMAL)
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
# Contacts
|
Authors
|
||||||
|
=======
|
||||||
|
|
||||||
Xing Xing <mikespook@gmail.com>
|
Xing Xing <mikespook@gmail.com> [Blog](http://mikespook.com) [@Twitter](http://twitter.com/mikespook)
|
||||||
|
|
||||||
[Blog](http://mikespook.com)
|
Open Source - MIT Software License
|
||||||
|
==================================
|
||||||
|
Copyright (c) 2012 Xing Xing
|
||||||
|
|
||||||
[@Twitter](http://twitter.com/mikespook)
|
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:
|
||||||
|
|
||||||
# History
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
* 0.1.2 Fixed issues: timeout executing, resources leaking.
|
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.
|
||||||
* 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
|
|
||||||
|
@ -11,8 +11,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
"bytes"
|
"bytes"
|
||||||
"strconv"
|
"strconv"
|
||||||
"bitbucket.org/mikespook/golib/autoinc"
|
"github.com/mikespook/golib/autoinc"
|
||||||
"bitbucket.org/mikespook/gearman-go/common"
|
"github.com/mikespook/gearman-go/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Job handler
|
// Job handler
|
||||||
|
@ -7,7 +7,7 @@ package client
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"bitbucket.org/mikespook/gearman-go/common"
|
"github.com/mikespook/gearman-go/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -3,7 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"sync"
|
"sync"
|
||||||
"bitbucket.org/mikespook/gearman-go/client"
|
"github.com/mikespook/gearman-go/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -10,8 +10,8 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"bitbucket.org/mikespook/golib/log"
|
"github.com/mikespook/golib/log"
|
||||||
"bitbucket.org/mikespook/gearman-go/worker"
|
"github.com/mikespook/gearman-go/worker"
|
||||||
)
|
)
|
||||||
|
|
||||||
type outData struct {
|
type outData struct {
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bitbucket.org/mikespook/golib/log"
|
"github.com/mikespook/golib/log"
|
||||||
"bitbucket.org/mikespook/gearman-go/worker"
|
"github.com/mikespook/gearman-go/worker"
|
||||||
)
|
)
|
||||||
|
|
||||||
func execShell(job *worker.Job) (result []byte, err error) {
|
func execShell(job *worker.Job) (result []byte, err error) {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bitbucket.org/mikespook/golib/log"
|
"github.com/mikespook/golib/log"
|
||||||
"flag"
|
"flag"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
@ -9,11 +9,11 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"flag"
|
"flag"
|
||||||
"time"
|
"time"
|
||||||
"bitbucket.org/mikespook/golib/log"
|
"github.com/mikespook/golib/log"
|
||||||
"bitbucket.org/mikespook/golib/pid"
|
"github.com/mikespook/golib/pid"
|
||||||
"bitbucket.org/mikespook/golib/prof"
|
"github.com/mikespook/golib/prof"
|
||||||
"bitbucket.org/mikespook/golib/signal"
|
"github.com/mikespook/golib/signal"
|
||||||
"bitbucket.org/mikespook/gearman-go/worker"
|
"github.com/mikespook/gearman-go/worker"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"time"
|
"time"
|
||||||
"strings"
|
"strings"
|
||||||
"bitbucket.org/mikespook/golib/signal"
|
"github.com/mikespook/golib/signal"
|
||||||
"bitbucket.org/mikespook/gearman-go/worker"
|
"github.com/mikespook/gearman-go/worker"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ToUpper(job *worker.Job) ([]byte, error) {
|
func ToUpper(job *worker.Job) ([]byte, error) {
|
||||||
|
@ -10,7 +10,7 @@ The protocol was implemented by native way.
|
|||||||
package gearman
|
package gearman
|
||||||
|
|
||||||
import (
|
import (
|
||||||
_ "bitbucket.org/mikespook/gearman-go/common"
|
_ "github.com/mikespook/gearman-go/common"
|
||||||
_ "bitbucket.org/mikespook/gearman-go/client"
|
_ "github.com/mikespook/gearman-go/client"
|
||||||
_ "bitbucket.org/mikespook/gearman-go/worker"
|
_ "github.com/mikespook/gearman-go/worker"
|
||||||
)
|
)
|
||||||
|
@ -7,7 +7,7 @@ package worker
|
|||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"bitbucket.org/mikespook/gearman-go/common"
|
"github.com/mikespook/gearman-go/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The agent of job server.
|
// The agent of job server.
|
||||||
|
@ -7,7 +7,7 @@ package worker
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"bitbucket.org/mikespook/gearman-go/common"
|
"github.com/mikespook/gearman-go/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Worker side job
|
// Worker side job
|
||||||
|
@ -7,7 +7,7 @@ package worker
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
"bytes"
|
"bytes"
|
||||||
"bitbucket.org/mikespook/gearman-go/common"
|
"github.com/mikespook/gearman-go/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
Loading…
Reference in New Issue
Block a user