summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-06 13:39:07 +0300
committerWolfy-J <[email protected]>2018-06-06 13:39:07 +0300
commit7067d593f243e86a54f4ffd87a06c744e5636e07 (patch)
tree83ba4ab9503059e2383fe40a04be6f1e7d2b9f2f /cmd
parentb49a888579be9dfc33069d168083c54fb354e24c (diff)
command factory
Diffstat (limited to 'cmd')
-rw-r--r--cmd/_____/factory.go37
1 files changed, 0 insertions, 37 deletions
diff --git a/cmd/_____/factory.go b/cmd/_____/factory.go
deleted file mode 100644
index cee962e2..00000000
--- a/cmd/_____/factory.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package _____
-
-import (
- "github.com/spiral/roadrunner"
- "os/exec"
- "strings"
- "time"
-)
-
-// todo: move out
-type PoolConfig struct {
- Command string
- Relay string
-
- Number uint64
- MaxJobs uint64
-
- Timeouts struct {
- Construct int
- Allocate int
- Destroy int
- }
-}
-
-func (f *PoolConfig) rrConfig() roadrunner.Config {
- return roadrunner.Config{
- NumWorkers: f.Number,
- MaxExecutions: f.MaxJobs,
- AllocateTimeout: time.Second * time.Duration(f.Timeouts.Allocate),
- DestroyTimeout: time.Second * time.Duration(f.Timeouts.Destroy),
- }
-}
-
-func (f *PoolConfig) cmd() func() *exec.Cmd {
- cmd := strings.Split(f.Command, " ")
- return func() *exec.Cmd { return exec.Command(cmd[0], cmd[1:]...) }
-}