server

package
v0.0.0-...-6ce5408 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrefixQueue    = "jobq"
	PrefixRecovery = "jobc"
)

Variables

This section is empty.

Functions

func GetMachineId

func GetMachineId(address string) int64

func RecoveryHandle

func RecoveryHandle(w *JobWork, cache *cache.CacheData, cli *kafka.WrapClient) error

Types

type JobWork

type JobWork struct {
	Topic   string
	Msg     string
	IsCache bool `json:"is_cache"`
	Jid     uint64
}

type Server

type Server struct {
	ErrChan chan error
	// contains filtered or unexported fields
}

func NewServer

func NewServer(sc *conf.Service, sp *conf.Kafka) (*Server, error)

func (*Server) GetUUid

func (s *Server) GetUUid() (int64, error)

func (*Server) Shutdown

func (s *Server) Shutdown() error

func (*Server) TransportMsg

func (s *Server) TransportMsg(topic, msg string, isWeb bool)

type WorkerPool

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

func NewWorkerPool

func NewWorkerPool(num, qsize, interval int) *WorkerPool

func (*WorkerPool) InitRecoveryAll

func (p *WorkerPool) InitRecoveryAll(cache *cache.CacheData) error

func (*WorkerPool) Run

func (p *WorkerPool) Run(cache *cache.CacheData, cp *kafka.ClientPool)

func (*WorkerPool) Stop

func (p *WorkerPool) Stop()

Jump to

Keyboard shortcuts

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