summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-01-28 19:03:27 +0300
committerWolfy-J <[email protected]>2018-01-28 19:03:27 +0300
commitf606426f00e9ad59f078474d4005ec55d1f3d3a9 (patch)
tree646eb86088b210dd952b8e6b932abd8b91dedcf2
parent76d72becd1226d8d79ca592c89693a629dc54dec (diff)
CS
-rw-r--r--pool_test.go4
-rw-r--r--protocol.go4
-rw-r--r--worker.go4
3 files changed, 6 insertions, 6 deletions
diff --git a/pool_test.go b/pool_test.go
index bada2fe8..c87f4ea7 100644
--- a/pool_test.go
+++ b/pool_test.go
@@ -77,7 +77,7 @@ func Test_Pool_Echo(t *testing.T) {
assert.Equal(t, "hello", res.String())
}
-func Test_Pool_Echo_NilHead(t *testing.T) {
+func Test_Pool_Echo_NilContext(t *testing.T) {
p, err := NewPool(
func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") },
NewPipeFactory(),
@@ -98,7 +98,7 @@ func Test_Pool_Echo_NilHead(t *testing.T) {
assert.Equal(t, "hello", res.String())
}
-func Test_Pool_Echo_Head(t *testing.T) {
+func Test_Pool_Echo_Context(t *testing.T) {
p, err := NewPool(
func() *exec.Cmd { return exec.Command("php", "tests/client.php", "head", "pipes") },
NewPipeFactory(),
diff --git a/protocol.go b/protocol.go
index 97d40c0c..564df9b7 100644
--- a/protocol.go
+++ b/protocol.go
@@ -15,7 +15,7 @@ type pidCommand struct {
Pid int `json:"pid"`
}
-func sendHead(rl goridge.Relay, v interface{}) error {
+func sendPayload(rl goridge.Relay, v interface{}) error {
if data, ok := v.([]byte); ok {
return rl.Send(data, goridge.PayloadControl|goridge.PayloadRaw)
}
@@ -29,7 +29,7 @@ func sendHead(rl goridge.Relay, v interface{}) error {
}
func fetchPID(rl goridge.Relay) (pid int, err error) {
- if err := sendHead(rl, pidCommand{Pid: os.Getpid()}); err != nil {
+ if err := sendPayload(rl, pidCommand{Pid: os.Getpid()}); err != nil {
return 0, err
}
diff --git a/worker.go b/worker.go
index df97871e..cc37b69d 100644
--- a/worker.go
+++ b/worker.go
@@ -126,7 +126,7 @@ func (w *Worker) Stop() error {
defer w.mu.Unlock()
w.state.set(StateInactive)
- err := sendHead(w.rl, &stopCommand{Stop: true})
+ err := sendPayload(w.rl, &stopCommand{Stop: true})
<-w.waitDone
return err
@@ -209,7 +209,7 @@ func (w *Worker) start() error {
}
func (w *Worker) execPayload(rqs *Payload) (rsp *Payload, err error) {
- if err := sendHead(w.rl, rqs.Context); err != nil {
+ if err := sendPayload(w.rl, rqs.Context); err != nil {
return nil, errors.Wrap(err, "header error")
}