The first workable version, both worker and client.
This commit is contained in:
parent
f6d2a16685
commit
b4a6f133e1
@ -40,13 +40,4 @@ func main() {
|
||||
} else {
|
||||
log.Println("Not running")
|
||||
}
|
||||
log.Println("read")
|
||||
if job, err := client.ReadJob(); err != nil {
|
||||
log.Println(err)
|
||||
} else {
|
||||
data, err := job.Result();
|
||||
log.Println(err)
|
||||
log.Println(data)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"os"
|
||||
"net"
|
||||
"sync"
|
||||
// "log"
|
||||
"log"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
@ -182,8 +182,12 @@ func (client *Client) Status(handle string) (known, running bool, numerator, den
|
||||
}
|
||||
known = data[1][0] == '1'
|
||||
running = data[2][0] == '1'
|
||||
numerator = uint(data[3][0])
|
||||
denominator = uint(data[4][0])
|
||||
if numerator, err = strconv.Atoui(string(data[3][0])); err != nil {
|
||||
return
|
||||
}
|
||||
if denominator, err = strconv.Atoui(string(data[4][0])); err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -195,7 +199,7 @@ func (client *Client) Echo(data []byte) (echo []byte, err os.Error) {
|
||||
if job, err = client.readLastJob(ECHO_RES); err != nil {
|
||||
return
|
||||
}
|
||||
echo, err = job.Result()
|
||||
echo = job.Data
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user