worker

package
v0.55.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandWorker

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

func NewCommandWorker

func NewCommandWorker(executable string) *CommandWorker

func (*CommandWorker) Handle

func (c *CommandWorker) Handle(r interface{}, w io.Writer) error

func (*CommandWorker) Key

func (c *CommandWorker) Key(r interface{}) string

type WorkHandler

type WorkHandler interface {
	Key(request interface{}) string
	Handle(request interface{}, w io.Writer) error
}

type WorkerServer

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

func NewWorkerServer

func NewWorkerServer(conf WorkerServerConf) *WorkerServer

func (*WorkerServer) Serve

func (s *WorkerServer) Serve(request interface{}, w io.Writer) error

TODO timeout & context

type WorkerServerConf

type WorkerServerConf struct {
	NumWorkers int
	CacheDir   string
	Worker     WorkHandler
}

Jump to

Keyboard shortcuts

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