factory

package
v2.0.0-alpha3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func (*App) Close

func (app *App) Close() error

func (*App) Configure

func (app *App) Configure() error

func (*App) Init

func (app *App) Init(provider config.Provider) error

func (*App) NewCmd

func (app *App) NewCmd(env Env) (func() *exec.Cmd, error)

func (*App) NewFactory

func (app *App) NewFactory() (roadrunner.Factory, error)

todo ENV unused

func (*App) Serve

func (app *App) Serve() chan error

func (*App) Stop

func (app *App) Stop() error

type AppConfig

type AppConfig struct {
	Command string
	User    string
	Group   string
	Env     Env

	Relay string
	// Listen 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.
	Listen string

	// RelayTimeout defines for how long socket factory will be waiting for worker connection. This config section
	// must not change on re-configuration.
	RelayTimeout time.Duration
}

AppConfig config combines factory, pool and cmd configurations.

type Env

type Env map[string]string

type Spawner

type Spawner interface {
	// CmdFactory create new command factory with given env variables.
	NewCmd(env Env) (func() *exec.Cmd, error)

	// NewFactory inits new factory for workers.
	NewFactory(env Env) (roadrunner.Factory, error)
}

type WFactory

type WFactory struct {
	// contains filtered or unexported fields
}

func (*WFactory) AddListener

func (wf *WFactory) AddListener(l events.EventListener)

func (*WFactory) Init

func (wf *WFactory) Init(app Spawner) error

func (*WFactory) NewWorker

func (wf *WFactory) NewWorker(ctx context.Context, env Env) (roadrunner.WorkerBase, error)

func (*WFactory) NewWorkerPool

func (wf *WFactory) NewWorkerPool(ctx context.Context, opt *roadrunner.Config, env Env) (roadrunner.Pool, error)

type WorkerFactory

type WorkerFactory interface {
	NewWorker(ctx context.Context, env Env) (roadrunner.WorkerBase, error)
	NewWorkerPool(ctx context.Context, opt *roadrunner.Config, env Env) (roadrunner.Pool, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL