complete the list of contributors
This commit is contained in:
parent
2c9d82830c
commit
b612b80f80
71
README.md
71
README.md
@ -37,41 +37,45 @@ Usage
|
|||||||
|
|
||||||
## Worker
|
## Worker
|
||||||
|
|
||||||
// Limit number of concurrent jobs execution. Use worker.Unlimited (0) if you want no limitation.
|
```go
|
||||||
w := worker.New(worker.OneByOne)
|
// Limit number of concurrent jobs execution. Use worker.Unlimited (0) if you want no limitation.
|
||||||
w.ErrHandler = func(e error) {
|
w := worker.New(worker.OneByOne)
|
||||||
|
w.ErrHandler = func(e error) {
|
||||||
log.Println(e)
|
log.Println(e)
|
||||||
}
|
}
|
||||||
w.AddServer("127.0.0.1:4730")
|
w.AddServer("127.0.0.1:4730")
|
||||||
// Use worker.Unlimited (0) if you want no timeout
|
// Use worker.Unlimited (0) if you want no timeout
|
||||||
w.AddFunc("ToUpper", ToUpper, worker.Unlimited)
|
w.AddFunc("ToUpper", ToUpper, worker.Unlimited)
|
||||||
// This will give a timeout of 5 seconds
|
// This will give a timeout of 5 seconds
|
||||||
w.AddFunc("ToUpperTimeOut5", ToUpper, 5)
|
w.AddFunc("ToUpperTimeOut5", ToUpper, 5)
|
||||||
if err := w.Ready(); err != nil {
|
|
||||||
|
if err := w.Ready(); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
go w.Work()
|
go w.Work()
|
||||||
|
```
|
||||||
|
|
||||||
## Client
|
## Client
|
||||||
|
|
||||||
// ...
|
```go
|
||||||
c, err := client.New("tcp4", "127.0.0.1:4730")
|
// ...
|
||||||
// ... error handling
|
c, err := client.New("tcp4", "127.0.0.1:4730")
|
||||||
defer c.Close()
|
// ... error handling
|
||||||
c.ErrorHandler = func(e error) {
|
defer c.Close()
|
||||||
|
c.ErrorHandler = func(e error) {
|
||||||
log.Println(e)
|
log.Println(e)
|
||||||
}
|
}
|
||||||
echo := []byte("Hello\x00 world")
|
echo := []byte("Hello\x00 world")
|
||||||
echomsg, err := c.Echo(echo)
|
echomsg, err := c.Echo(echo)
|
||||||
// ... error handling
|
// ... error handling
|
||||||
log.Println(string(echomsg))
|
log.Println(string(echomsg))
|
||||||
jobHandler := func(resp *client.Response) {
|
jobHandler := func(resp *client.Response) {
|
||||||
log.Printf("%s", resp.Data)
|
log.Printf("%s", resp.Data)
|
||||||
}
|
}
|
||||||
handle, err := c.Do("ToUpper", echo, client.JobNormal, jobHandler)
|
handle, err := c.Do("ToUpper", echo, client.JobNormal, jobHandler)
|
||||||
// ...
|
// ...
|
||||||
|
```
|
||||||
|
|
||||||
Branches
|
Branches
|
||||||
========
|
========
|
||||||
@ -87,10 +91,15 @@ __Use at your own risk!__
|
|||||||
Contributors
|
Contributors
|
||||||
============
|
============
|
||||||
|
|
||||||
|
Great thanks to all of you for your support and interest!
|
||||||
|
|
||||||
(_Alphabetic order_)
|
(_Alphabetic order_)
|
||||||
|
|
||||||
* [Alex Zylman](https://github.com/azylman)
|
* [Alex Zylman](https://github.com/azylman)
|
||||||
|
* [C.R. Kirkwood-Watts](https://github.com/kirkwood)
|
||||||
* [Damian Gryski](https://github.com/dgryski)
|
* [Damian Gryski](https://github.com/dgryski)
|
||||||
|
* [Gabriel Cristian Alecu](https://github.com/AzuraMeta)
|
||||||
|
* [Graham Barr](https://github.com/gbarr)
|
||||||
* [Ingo Oeser](https://github.com/nightlyone)
|
* [Ingo Oeser](https://github.com/nightlyone)
|
||||||
* [jake](https://github.com/jbaikge)
|
* [jake](https://github.com/jbaikge)
|
||||||
* [Joe Higton](https://github.com/draxil)
|
* [Joe Higton](https://github.com/draxil)
|
||||||
@ -98,9 +107,13 @@ Contributors
|
|||||||
* [Kevin Darlington](https://github.com/kdar)
|
* [Kevin Darlington](https://github.com/kdar)
|
||||||
* [miraclesu](https://github.com/miraclesu)
|
* [miraclesu](https://github.com/miraclesu)
|
||||||
* [Paul Mach](https://github.com/paulmach)
|
* [Paul Mach](https://github.com/paulmach)
|
||||||
|
* [Randall McPherson](https://github.com/rlmcpherson)
|
||||||
* [Sam Grimee](https://github.com/sgrimee)
|
* [Sam Grimee](https://github.com/sgrimee)
|
||||||
* suchj
|
|
||||||
* [Xing Xing](http://mikespook.com) <mikespook@gmail.com> [@Twitter](http://twitter.com/mikespook)
|
Maintainer
|
||||||
|
==========
|
||||||
|
|
||||||
|
* [Xing Xing](http://mikespook.com) <<mikespook@gmail.com>> [@Twitter](http://twitter.com/mikespook)
|
||||||
|
|
||||||
Open Source - MIT Software License
|
Open Source - MIT Software License
|
||||||
==================================
|
==================================
|
||||||
|
Loading…
Reference in New Issue
Block a user