server

package
v0.0.0-...-b15c4a3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeout = errors.New("exec Func time out")
	ErrFunc    = errors.New("func format error")
)

Functions

This section is empty.

Types

type FuncWorker

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

func NewFuncWorker

func NewFuncWorker(name string, wFunc interface{}) FuncWorker

type Server

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

func GetServer

func GetServer() *Server

func NewServer

func NewServer(opts ...WorkerOpt) *Server

func (*Server) CloneBackend

func (s *Server) CloneBackend() backend.Backend

func (*Server) CloneBroker

func (s *Server) CloneBroker() broker.Broker

func (*Server) Reg

func (s *Server) Reg(funcName string, wFunc interface{})

func (*Server) Run

func (s *Server) Run(numWorkers int) (err error)

启动

func (*Server) ShutDown

func (s *Server) ShutDown()

type Worker

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

func NewWorker

func NewWorker() *Worker

func (*Worker) RetryTask

func (w *Worker) RetryTask(msg *message.Message) (err error)

func (*Worker) Run

func (w *Worker) Run(numWorker int) error

func (*Worker) Stop

func (w *Worker) Stop()

type WorkerOpt

type WorkerOpt func(w *Worker)

func WithBackend

func WithBackend(backend backend.Backend) WorkerOpt

func WithBroker

func WithBroker(broker broker.Broker) WorkerOpt

Jump to

Keyboard shortcuts

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