diff options
Diffstat (limited to 'server_config.go')
-rw-r--r-- | server_config.go | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/server_config.go b/server_config.go index 37f3359b..99eaa678 100644 --- a/server_config.go +++ b/server_config.go @@ -5,6 +5,7 @@ import ( "net" "strings" "time" + "os/exec" ) const ( @@ -12,7 +13,20 @@ const ( FactorySocket ) +// Server config combines factory, pool and cmd configurations. type ServerConfig struct { + // Command includes command strings with all the parameters, example: "php worker.php pipes". This config section + // // must not change on re-configuration. + Command string + + // User specifies what user to run command under, for Unix systems only. Support both UID and name options. Keep + // empty to use current user.This config section must not change on re-configuration. + User string + + // Group specifies what group to run command under, for Unix systems only. Support GID or name options. Keep empty + // to use current user.This config section must not change on re-configuration. + Group string + // Relay defines connection method and factory to be used to connect to workers: // "pipes", "tcp://:6001", "unix://rr.sock" // This config section must not change on re-configuration. @@ -24,12 +38,16 @@ type ServerConfig struct { // Pool defines worker pool configuration, number of workers, timeouts and etc. This config section might change // while server is running. - Pool Config + Pool *Config +} + +func (f *ServerConfig) makeCommand() (func() *exec.Cmd, error) { + return nil, nil } -// buildFactory creates and connects new factory instance based on given parameters. -func (f *ServerConfig) buildFactory() (Factory, error) { - if f.Relay == "pipes" { +// makeFactory creates and connects new factory instance based on given parameters. +func (f *ServerConfig) makeFactory() (Factory, error) { + if f.Relay == "pipes" || f.Relay == "pipe" { return NewPipeFactory(), nil } |