Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j committed Jan 28, 2018
1 parent 76d72be commit f606426
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pool_test.go
Expand Up @@ -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(),
Expand All @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions protocol.go
Expand Up @@ -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)
}
Expand All @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions worker.go
Expand Up @@ -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
Expand Down Expand Up @@ -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")
}

Expand Down

0 comments on commit f606426

Please sign in to comment.