diff options
-rw-r--r-- | cmd/rr-php/cmd/serve.go | 10 | ||||
-rw-r--r-- | router.go | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/cmd/rr-php/cmd/serve.go b/cmd/rr-php/cmd/serve.go index 9540a986..cac830ac 100644 --- a/cmd/rr-php/cmd/serve.go +++ b/cmd/rr-php/cmd/serve.go @@ -20,6 +20,7 @@ import ( "os/exec" "log" "time" + "github.com/sirupsen/logrus" ) func init() { @@ -43,9 +44,18 @@ func serveHandler(cmd *cobra.Command, args []string) { DestroyTimeout: time.Minute, }) + r.Observe(func(event int, ctx interface{}) { + logrus.Info(ctx) + }) + if err != nil { panic(err) } + for i := 0; i < 10; i++ { + r.Exec(&roadrunner.Payload{}) + } + log.Print(r.Workers()) + } @@ -3,7 +3,7 @@ package roadrunner import ( "sync" "os/exec" - "github.com/go-errors/errors" + "fmt" ) const ( @@ -85,7 +85,7 @@ func (r *Router) Pool() (Pool, error) { defer r.mu.Unlock() if r.pool == nil { - return nil, errors.New("no associated pool") + return nil, fmt.Errorf("no associated pool") } return r.pool, nil |