summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-05 16:56:12 +0300
committerWolfy-J <[email protected]>2018-06-05 16:56:12 +0300
commit3112f9b58c73773cea972fd79f04d33f8f7d7edd (patch)
tree334941e56becd1dde9fd1ce353e63d63775d772b /cmd
parent76ff8d1c95e087749d559ee5a4f8f0348feafffa (diff)
Cs and refactoring
Diffstat (limited to 'cmd')
-rw-r--r--cmd/_____/factory.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/cmd/_____/factory.go b/cmd/_____/factory.go
index 8ecf90ca..cee962e2 100644
--- a/cmd/_____/factory.go
+++ b/cmd/_____/factory.go
@@ -2,7 +2,6 @@ package _____
import (
"github.com/spiral/roadrunner"
- "net"
"os/exec"
"strings"
"time"
@@ -23,21 +22,6 @@ type PoolConfig struct {
}
}
-func (f *PoolConfig) NewServer() (*roadrunner.Server, func(), error) {
- relays, terminator, err := f.relayFactory()
- if err != nil {
- terminator()
- return nil, nil, err
- }
-
- rr := roadrunner.NewServer(f.cmd(), relays)
- if err := rr.Configure(f.rrConfig()); err != nil {
- return nil, nil, err
- }
-
- return rr, nil, nil
-}
-
func (f *PoolConfig) rrConfig() roadrunner.Config {
return roadrunner.Config{
NumWorkers: f.Number,
@@ -51,21 +35,3 @@ func (f *PoolConfig) cmd() func() *exec.Cmd {
cmd := strings.Split(f.Command, " ")
return func() *exec.Cmd { return exec.Command(cmd[0], cmd[1:]...) }
}
-
-func (f *PoolConfig) relayFactory() (roadrunner.Factory, func(), error) {
- if f.Relay == "pipes" || f.Relay == "pipe" {
- return roadrunner.NewPipeFactory(), nil, nil
- }
-
- dsn := strings.Split(f.Relay, "://")
- if len(dsn) != 2 {
- return nil, nil, dsnError
- }
-
- ln, err := net.Listen(dsn[0], dsn[1])
- if err != nil {
- return nil, nil, err
- }
-
- return roadrunner.NewSocketFactory(ln, time.Minute), func() { ln.Close() }, nil
-}