summaryrefslogtreecommitdiff
path: root/interfaces/server/interface.go
blob: c50848d75b2d36ee2874a3e79a77c685c12de907 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package server

import (
	"context"
	"os/exec"

	"github.com/spiral/roadrunner/v2/interfaces/pool"
	"github.com/spiral/roadrunner/v2/interfaces/worker"
	poolImpl "github.com/spiral/roadrunner/v2/pkg/pool"
)

type Env map[string]string

// Server creates workers for the application.
type Server interface {
	CmdFactory(env Env) (func() *exec.Cmd, error)
	NewWorker(ctx context.Context, env Env) (worker.BaseProcess, error)
	NewWorkerPool(ctx context.Context, opt poolImpl.Config, env Env) (pool.Pool, error)
}