summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-05-31 15:19:54 +0300
committerWolfy-J <[email protected]>2018-05-31 15:19:54 +0300
commit91a081e3ec43302ca1df8d436e48c2a14d7c76b9 (patch)
tree7c644b8bccf04f1a8dd5c07314665152dbea6d63
parent48f4f7a39a2336be24cc74b4116c02cc941dbd9a (diff)
psr7 support
-rw-r--r--README.md2
-rw-r--r--cmd/rr-php/cmd/serve.go2
-rw-r--r--composer.json2
-rw-r--r--php-src/Exceptions/RoadRunnerException.php (renamed from php/Exceptions/RoadRunnerException.php)0
-rw-r--r--php-src/Worker.php (renamed from php/Worker.php)0
-rw-r--r--php-src/tests/broken.php (renamed from php/tests/broken.php)0
-rw-r--r--php-src/tests/client.php (renamed from php/tests/client.php)0
-rw-r--r--php-src/tests/delay.php (renamed from php/tests/delay.php)0
-rw-r--r--php-src/tests/echo.php (renamed from php/tests/echo.php)0
-rw-r--r--php-src/tests/error.php (renamed from php/tests/error.php)0
-rw-r--r--php-src/tests/failboot.php (renamed from php/tests/failboot.php)0
-rw-r--r--php-src/tests/head.php (renamed from php/tests/head.php)0
-rw-r--r--php-src/tests/pid.php (renamed from php/tests/pid.php)0
-rw-r--r--php-src/tests/slow-client.php (renamed from php/tests/slow-client.php)0
-rw-r--r--php-src/tests/stop.php (renamed from php/tests/stop.php)0
-rw-r--r--pipe_factory_test.go20
-rw-r--r--psr7/files.go (renamed from http/files.go)2
-rw-r--r--psr7/post.go (renamed from http/post.go)2
-rw-r--r--psr7/request.go (renamed from http/request.go)2
-rw-r--r--psr7/response.go (renamed from http/response.go)2
-rw-r--r--psr7/server.go (renamed from http/server.go)2
-rw-r--r--socket_factory_test.go34
-rw-r--r--static_pool_test.go30
-rw-r--r--worker_test.go24
24 files changed, 62 insertions, 62 deletions
diff --git a/README.md b/README.md
index 6dd3a9a6..4bdb99a7 100644
--- a/README.md
+++ b/README.md
@@ -69,7 +69,7 @@ while ($body = $rr->receive($context)) {
}
}
```
-> Check how to init relay [here](./php/tests/client.php). More examples can be found in tests.
+> Check how to init relay [here](./php-src/tests/client.php). More examples can be found in tests.
License:
--------
diff --git a/cmd/rr-php/cmd/serve.go b/cmd/rr-php/cmd/serve.go
index ce19414b..69b53e28 100644
--- a/cmd/rr-php/cmd/serve.go
+++ b/cmd/rr-php/cmd/serve.go
@@ -20,7 +20,7 @@ import (
"os/exec"
"time"
"github.com/sirupsen/logrus"
- rrhttp "github.com/spiral/roadrunner/http"
+ rrhttp "github.com/spiral/roadrunner/psr7"
"net/http"
)
diff --git a/composer.json b/composer.json
index 64416814..ada34e58 100644
--- a/composer.json
+++ b/composer.json
@@ -18,7 +18,7 @@
},
"autoload": {
"psr-4": {
- "Spiral\\RoadRunner\\": "php/"
+ "Spiral\\RoadRunner\\": "php-src/"
}
}
} \ No newline at end of file
diff --git a/php/Exceptions/RoadRunnerException.php b/php-src/Exceptions/RoadRunnerException.php
index fa7b8da3..fa7b8da3 100644
--- a/php/Exceptions/RoadRunnerException.php
+++ b/php-src/Exceptions/RoadRunnerException.php
diff --git a/php/Worker.php b/php-src/Worker.php
index 5835baf2..5835baf2 100644
--- a/php/Worker.php
+++ b/php-src/Worker.php
diff --git a/php/tests/broken.php b/php-src/tests/broken.php
index b1a3839e..b1a3839e 100644
--- a/php/tests/broken.php
+++ b/php-src/tests/broken.php
diff --git a/php/tests/client.php b/php-src/tests/client.php
index fd5d60be..fd5d60be 100644
--- a/php/tests/client.php
+++ b/php-src/tests/client.php
diff --git a/php/tests/delay.php b/php-src/tests/delay.php
index bfde2fc4..bfde2fc4 100644
--- a/php/tests/delay.php
+++ b/php-src/tests/delay.php
diff --git a/php/tests/echo.php b/php-src/tests/echo.php
index ba58ff30..ba58ff30 100644
--- a/php/tests/echo.php
+++ b/php-src/tests/echo.php
diff --git a/php/tests/error.php b/php-src/tests/error.php
index ebd3418b..ebd3418b 100644
--- a/php/tests/error.php
+++ b/php-src/tests/error.php
diff --git a/php/tests/failboot.php b/php-src/tests/failboot.php
index fa8b96f6..fa8b96f6 100644
--- a/php/tests/failboot.php
+++ b/php-src/tests/failboot.php
diff --git a/php/tests/head.php b/php-src/tests/head.php
index 4f4e4061..4f4e4061 100644
--- a/php/tests/head.php
+++ b/php-src/tests/head.php
diff --git a/php/tests/pid.php b/php-src/tests/pid.php
index a8cfa229..a8cfa229 100644
--- a/php/tests/pid.php
+++ b/php-src/tests/pid.php
diff --git a/php/tests/slow-client.php b/php-src/tests/slow-client.php
index 2722868c..2722868c 100644
--- a/php/tests/slow-client.php
+++ b/php-src/tests/slow-client.php
diff --git a/php/tests/stop.php b/php-src/tests/stop.php
index caa485d6..caa485d6 100644
--- a/php/tests/stop.php
+++ b/php-src/tests/stop.php
diff --git a/pipe_factory_test.go b/pipe_factory_test.go
index 133bb266..ae276ab6 100644
--- a/pipe_factory_test.go
+++ b/pipe_factory_test.go
@@ -7,7 +7,7 @@ import (
)
func Test_Pipe_Start(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
w, err := NewPipeFactory().SpawnWorker(cmd)
assert.NoError(t, err)
@@ -21,7 +21,7 @@ func Test_Pipe_Start(t *testing.T) {
}
func Test_Pipe_StartError(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
cmd.Start()
w, err := NewPipeFactory().SpawnWorker(cmd)
@@ -30,7 +30,7 @@ func Test_Pipe_StartError(t *testing.T) {
}
func Test_Pipe_PipeError(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
cmd.StdinPipe()
w, err := NewPipeFactory().SpawnWorker(cmd)
@@ -39,7 +39,7 @@ func Test_Pipe_PipeError(t *testing.T) {
}
func Test_Pipe_PipeError2(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
cmd.StdoutPipe()
w, err := NewPipeFactory().SpawnWorker(cmd)
@@ -48,7 +48,7 @@ func Test_Pipe_PipeError2(t *testing.T) {
}
func Test_Pipe_Failboot(t *testing.T) {
- cmd := exec.Command("php", "php/tests/failboot.php")
+ cmd := exec.Command("php", "php-src/tests/failboot.php")
w, err := NewPipeFactory().SpawnWorker(cmd)
assert.Nil(t, w)
@@ -57,7 +57,7 @@ func Test_Pipe_Failboot(t *testing.T) {
}
func Test_Pipe_Invalid(t *testing.T) {
- cmd := exec.Command("php", "php/tests/invalid.php")
+ cmd := exec.Command("php", "php-src/tests/invalid.php")
w, err := NewPipeFactory().SpawnWorker(cmd)
assert.Error(t, err)
@@ -65,7 +65,7 @@ func Test_Pipe_Invalid(t *testing.T) {
}
func Test_Pipe_Echo(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
w, _ := NewPipeFactory().SpawnWorker(cmd)
go func() {
@@ -84,7 +84,7 @@ func Test_Pipe_Echo(t *testing.T) {
}
func Test_Pipe_Broken(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "broken", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "broken", "pipes")
w, _ := NewPipeFactory().SpawnWorker(cmd)
go func() {
@@ -104,7 +104,7 @@ func Test_Pipe_Broken(t *testing.T) {
func Benchmark_Pipe_SpawnWorker_Stop(b *testing.B) {
f := NewPipeFactory()
for n := 0; n < b.N; n++ {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
w, _ := f.SpawnWorker(cmd)
go func() {
if w.Wait() != nil {
@@ -117,7 +117,7 @@ func Benchmark_Pipe_SpawnWorker_Stop(b *testing.B) {
}
func Benchmark_Pipe_Worker_ExecEcho(b *testing.B) {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
w, _ := NewPipeFactory().SpawnWorker(cmd)
go func() {
diff --git a/http/files.go b/psr7/files.go
index 06e5fd24..31ddfec8 100644
--- a/http/files.go
+++ b/psr7/files.go
@@ -1,4 +1,4 @@
-package http
+package psr7
import (
"mime/multipart"
diff --git a/http/post.go b/psr7/post.go
index 64c60d98..30af7e3a 100644
--- a/http/post.go
+++ b/psr7/post.go
@@ -1,4 +1,4 @@
-package http
+package psr7
import "strings"
diff --git a/http/request.go b/psr7/request.go
index 032c70b5..41fbb4bf 100644
--- a/http/request.go
+++ b/psr7/request.go
@@ -1,4 +1,4 @@
-package http
+package psr7
import (
"net/http"
diff --git a/http/response.go b/psr7/response.go
index 6a094bf3..6c5f3e17 100644
--- a/http/response.go
+++ b/psr7/response.go
@@ -1,4 +1,4 @@
-package http
+package psr7
import (
"net/http"
diff --git a/http/server.go b/psr7/server.go
index b0d0b56a..a1c26146 100644
--- a/http/server.go
+++ b/psr7/server.go
@@ -1,4 +1,4 @@
-package http
+package psr7
import (
"github.com/spiral/roadrunner"
diff --git a/socket_factory_test.go b/socket_factory_test.go
index 4339b99c..3bb60ab0 100644
--- a/socket_factory_test.go
+++ b/socket_factory_test.go
@@ -19,7 +19,7 @@ func Test_Tcp_Start(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/client.php", "echo", "tcp")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "tcp")
w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
assert.NoError(t, err)
@@ -42,7 +42,7 @@ func Test_Tcp_StartError(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
cmd.Start()
w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
@@ -60,7 +60,7 @@ func Test_Tcp_Failboot(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/failboot.php")
+ cmd := exec.Command("php", "php-src/tests/failboot.php")
w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
assert.Nil(t, w)
@@ -78,7 +78,7 @@ func Test_Tcp_Timeout(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/slow-client.php", "echo", "tcp", "200", "0")
+ cmd := exec.Command("php", "php-src/tests/slow-client.php", "echo", "tcp", "200", "0")
w, err := NewSocketFactory(ls, time.Millisecond*100).SpawnWorker(cmd)
assert.Nil(t, w)
@@ -96,7 +96,7 @@ func Test_Tcp_Invalid(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/invalid.php")
+ cmd := exec.Command("php", "php-src/tests/invalid.php")
w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
assert.Error(t, err)
@@ -113,7 +113,7 @@ func Test_Tcp_Broken(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/client.php", "broken", "tcp")
+ cmd := exec.Command("php", "php-src/tests/client.php", "broken", "tcp")
w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
go func() {
@@ -140,7 +140,7 @@ func Test_Tcp_Echo(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/client.php", "echo", "tcp")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "tcp")
w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
go func() {
@@ -170,7 +170,7 @@ func Test_Unix_Start(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/client.php", "echo", "unix")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "unix")
w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
assert.NoError(t, err)
@@ -195,7 +195,7 @@ func Test_Unix_Failboot(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/failboot.php")
+ cmd := exec.Command("php", "php-src/tests/failboot.php")
w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
assert.Nil(t, w)
@@ -215,7 +215,7 @@ func Test_Unix_Timeout(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/slow-client.php", "echo", "unix", "200", "0")
+ cmd := exec.Command("php", "php-src/tests/slow-client.php", "echo", "unix", "200", "0")
w, err := NewSocketFactory(ls, time.Millisecond*100).SpawnWorker(cmd)
assert.Nil(t, w)
@@ -235,7 +235,7 @@ func Test_Unix_Invalid(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/invalid.php")
+ cmd := exec.Command("php", "php-src/tests/invalid.php")
w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
assert.Error(t, err)
@@ -254,7 +254,7 @@ func Test_Unix_Broken(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/client.php", "broken", "unix")
+ cmd := exec.Command("php", "php-src/tests/client.php", "broken", "unix")
w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
go func() {
@@ -283,7 +283,7 @@ func Test_Unix_Echo(t *testing.T) {
t.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/client.php", "echo", "unix")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "unix")
w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
go func() {
@@ -311,7 +311,7 @@ func Benchmark_Tcp_SpawnWorker_Stop(b *testing.B) {
f := NewSocketFactory(ls, time.Minute)
for n := 0; n < b.N; n++ {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "tcp")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "tcp")
w, _ := f.SpawnWorker(cmd)
go func() {
@@ -332,7 +332,7 @@ func Benchmark_Tcp_Worker_ExecEcho(b *testing.B) {
b.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/client.php", "echo", "tcp")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "tcp")
w, _ := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
go func() {
@@ -361,7 +361,7 @@ func Benchmark_Unix_SpawnWorker_Stop(b *testing.B) {
f := NewSocketFactory(ls, time.Minute)
for n := 0; n < b.N; n++ {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "unix")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "unix")
w, _ := f.SpawnWorker(cmd)
go func() {
@@ -386,7 +386,7 @@ func Benchmark_Unix_Worker_ExecEcho(b *testing.B) {
b.Skip("socket is busy")
}
- cmd := exec.Command("php", "php/tests/client.php", "echo", "unix")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "unix")
w, _ := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd)
go func() {
diff --git a/static_pool_test.go b/static_pool_test.go
index 64635716..a89cec0a 100644
--- a/static_pool_test.go
+++ b/static_pool_test.go
@@ -19,7 +19,7 @@ var cfg = Config{
func Test_NewPool(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -33,7 +33,7 @@ func Test_NewPool(t *testing.T) {
func Test_StaticPool_Invalid(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/invalid.php") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/invalid.php") },
NewPipeFactory(),
cfg,
)
@@ -44,7 +44,7 @@ func Test_StaticPool_Invalid(t *testing.T) {
func Test_ConfigError(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
Config{
AllocateTimeout: time.Second,
@@ -58,7 +58,7 @@ func Test_ConfigError(t *testing.T) {
func Test_StaticPool_Echo(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -79,7 +79,7 @@ func Test_StaticPool_Echo(t *testing.T) {
func Test_StaticPool_Echo_NilContext(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -100,7 +100,7 @@ func Test_StaticPool_Echo_NilContext(t *testing.T) {
func Test_StaticPool_Echo_Context(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "head", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "head", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -121,7 +121,7 @@ func Test_StaticPool_Echo_Context(t *testing.T) {
func Test_StaticPool_JobError(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "error", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "error", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -141,7 +141,7 @@ func Test_StaticPool_JobError(t *testing.T) {
func Test_StaticPool_Broken_Replace(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "broken", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "broken", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -164,7 +164,7 @@ func Test_StaticPool_Broken_Replace(t *testing.T) {
func Test_StaticPool_AllocateTimeout(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "delay", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "delay", "pipes") },
NewPipeFactory(),
Config{
NumWorkers: 1,
@@ -196,7 +196,7 @@ func Test_StaticPool_AllocateTimeout(t *testing.T) {
func Test_StaticPool_Replace_Worker(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "pid", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "pid", "pipes") },
NewPipeFactory(),
Config{
NumWorkers: 1,
@@ -232,7 +232,7 @@ func Test_StaticPool_Replace_Worker(t *testing.T) {
// identical to replace but controlled on worker side
func Test_StaticPool_Stop_Worker(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "stop", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "stop", "pipes") },
NewPipeFactory(),
Config{
NumWorkers: 1,
@@ -266,7 +266,7 @@ func Test_StaticPool_Stop_Worker(t *testing.T) {
func Benchmark_Pool_Allocate(b *testing.B) {
p, _ := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -285,7 +285,7 @@ func Benchmark_Pool_Allocate(b *testing.B) {
func Benchmark_Pool_Echo(b *testing.B) {
p, _ := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -300,7 +300,7 @@ func Benchmark_Pool_Echo(b *testing.B) {
func Benchmark_Pool_Echo_Batched(b *testing.B) {
p, _ := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -323,7 +323,7 @@ func Benchmark_Pool_Echo_Batched(b *testing.B) {
func Benchmark_Pool_Echo_Replaced(b *testing.B) {
p, _ := NewPool(
- func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
Config{
NumWorkers: 1,
diff --git a/worker_test.go b/worker_test.go
index e1af13c4..362db1f6 100644
--- a/worker_test.go
+++ b/worker_test.go
@@ -8,7 +8,7 @@ import (
)
func Test_GetState(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
w, err := NewPipeFactory().SpawnWorker(cmd)
go func() {
@@ -24,7 +24,7 @@ func Test_GetState(t *testing.T) {
}
func Test_Echo(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
w, _ := NewPipeFactory().SpawnWorker(cmd)
go func() {
@@ -43,16 +43,16 @@ func Test_Echo(t *testing.T) {
}
func Test_NotStarted_String(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
w, _ := newWorker(cmd)
- assert.Contains(t, w.String(), "php php/tests/client.php echo pipes")
+ assert.Contains(t, w.String(), "php php-src/tests/client.php echo pipes")
assert.Contains(t, w.String(), "inactive")
assert.Contains(t, w.String(), "numExecs: 0")
}
func Test_String(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
w, _ := NewPipeFactory().SpawnWorker(cmd)
go func() {
@@ -60,13 +60,13 @@ func Test_String(t *testing.T) {
}()
defer w.Stop()
- assert.Contains(t, w.String(), "php php/tests/client.php echo pipes")
+ assert.Contains(t, w.String(), "php php-src/tests/client.php echo pipes")
assert.Contains(t, w.String(), "ready")
assert.Contains(t, w.String(), "numExecs: 0")
}
func Test_Echo_Slow(t *testing.T) {
- cmd := exec.Command("php", "php/tests/slow-client.php", "echo", "pipes", "10", "10")
+ cmd := exec.Command("php", "php-src/tests/slow-client.php", "echo", "pipes", "10", "10")
w, _ := NewPipeFactory().SpawnWorker(cmd)
go func() {
@@ -85,7 +85,7 @@ func Test_Echo_Slow(t *testing.T) {
}
func Test_Broken(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "broken", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "broken", "pipes")
w, err := NewPipeFactory().SpawnWorker(cmd)
go func() {
@@ -101,7 +101,7 @@ func Test_Broken(t *testing.T) {
}
func Test_OnStarted(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "broken", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "broken", "pipes")
assert.Nil(t, cmd.Start())
w, err := newWorker(cmd)
@@ -112,7 +112,7 @@ func Test_OnStarted(t *testing.T) {
}
func Test_Error(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "error", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "error", "pipes")
w, _ := NewPipeFactory().SpawnWorker(cmd)
go func() {
@@ -129,7 +129,7 @@ func Test_Error(t *testing.T) {
}
func Test_NumExecs(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
w, _ := NewPipeFactory().SpawnWorker(cmd)
go func() {
@@ -148,7 +148,7 @@ func Test_NumExecs(t *testing.T) {
}
func Test_StateUpdated(t *testing.T) {
- cmd := exec.Command("php", "php/tests/client.php", "echo", "pipes")
+ cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes")
w, _ := NewPipeFactory().SpawnWorker(cmd)
go func() {