server

package
v2.0.0-alpha23 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const PluginName = "server"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Command to run as application.
	Command string

	// User to run application under.
	User string

	// Group to run application under.
	Group string

	// Env represents application environment.
	Env server.Env

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

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

Config config combines factory, pool and cmd configurations.

func (*Config) InitDefaults

func (cfg *Config) InitDefaults()

type Plugin

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

Plugin manages worker

func (*Plugin) CmdFactory

func (server *Plugin) CmdFactory(env server.Env) (func() *exec.Cmd, error)

CmdFactory provides worker command factory assocated with given context.

func (*Plugin) Init

func (server *Plugin) Init(cfg config.Configurer, log log.Logger) error

Init application provider.

func (*Plugin) Name

func (server *Plugin) Name() string

Name contains service name.

func (*Plugin) NewWorker

func (server *Plugin) NewWorker(ctx context.Context, env server.Env) (worker.BaseProcess, error)

NewWorker issues new standalone worker.

func (*Plugin) NewWorkerPool

func (server *Plugin) NewWorkerPool(ctx context.Context, opt poolImpl.Config, env server.Env) (pool.Pool, error)

NewWorkerPool issues new worker pool.

func (*Plugin) Serve

func (server *Plugin) Serve() chan error

func (*Plugin) Stop

func (server *Plugin) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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