Skip to content

Commit f606426

Browse files
committed
CS
1 parent 76d72be commit f606426

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pool_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func Test_Pool_Echo(t *testing.T) {
7777
assert.Equal(t, "hello", res.String())
7878
}
7979

80-
func Test_Pool_Echo_NilHead(t *testing.T) {
80+
func Test_Pool_Echo_NilContext(t *testing.T) {
8181
p, err := NewPool(
8282
func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") },
8383
NewPipeFactory(),
@@ -98,7 +98,7 @@ func Test_Pool_Echo_NilHead(t *testing.T) {
9898
assert.Equal(t, "hello", res.String())
9999
}
100100

101-
func Test_Pool_Echo_Head(t *testing.T) {
101+
func Test_Pool_Echo_Context(t *testing.T) {
102102
p, err := NewPool(
103103
func() *exec.Cmd { return exec.Command("php", "tests/client.php", "head", "pipes") },
104104
NewPipeFactory(),

protocol.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type pidCommand struct {
1515
Pid int `json:"pid"`
1616
}
1717

18-
func sendHead(rl goridge.Relay, v interface{}) error {
18+
func sendPayload(rl goridge.Relay, v interface{}) error {
1919
if data, ok := v.([]byte); ok {
2020
return rl.Send(data, goridge.PayloadControl|goridge.PayloadRaw)
2121
}
@@ -29,7 +29,7 @@ func sendHead(rl goridge.Relay, v interface{}) error {
2929
}
3030

3131
func fetchPID(rl goridge.Relay) (pid int, err error) {
32-
if err := sendHead(rl, pidCommand{Pid: os.Getpid()}); err != nil {
32+
if err := sendPayload(rl, pidCommand{Pid: os.Getpid()}); err != nil {
3333
return 0, err
3434
}
3535

worker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (w *Worker) Stop() error {
126126
defer w.mu.Unlock()
127127

128128
w.state.set(StateInactive)
129-
err := sendHead(w.rl, &stopCommand{Stop: true})
129+
err := sendPayload(w.rl, &stopCommand{Stop: true})
130130

131131
<-w.waitDone
132132
return err
@@ -209,7 +209,7 @@ func (w *Worker) start() error {
209209
}
210210

211211
func (w *Worker) execPayload(rqs *Payload) (rsp *Payload, err error) {
212-
if err := sendHead(w.rl, rqs.Context); err != nil {
212+
if err := sendPayload(w.rl, rqs.Context); err != nil {
213213
return nil, errors.Wrap(err, "header error")
214214
}
215215

0 commit comments

Comments
 (0)