Documentation ¶
Index ¶
- Constants
- func GetConn(p pool.Pool, timeout int) (*grpc.ClientConn, error)
- func GetPool(target string, min, max int) (pool.Pool, error)
- func GetQueueName(workerID, taskType string, reserved int) string
- func GetQueueNameByCluster(taskType, cluster string) string
- func InitMQInitMachineryServerWorker(queueName string, invoke Invoke, redis *redis.Config, concurrencyNum int, ...) (*machinery.Worker, error)
- func InitMachineryServer(queueName string, redis *redis.Config) (*machinery.Server, error)
- func ReturnConn(p pool.Pool, conn *grpc.ClientConn, err error) error
- func SetLoggerLevel(logger logging.ILogger)
- type Consumer
- type ConsumerUnit
- type IWorker
- type Invoke
- type Logger
- func (m *Logger) Fatal(args ...interface{})
- func (m *Logger) Fatalf(str string, args ...interface{})
- func (m *Logger) Fatalln(args ...interface{})
- func (m *Logger) Panic(args ...interface{})
- func (m *Logger) Panicf(str string, args ...interface{})
- func (m *Logger) Panicln(args ...interface{})
- func (m *Logger) Print(args ...interface{})
- func (m *Logger) Printf(str string, args ...interface{})
- func (m *Logger) Println(args ...interface{})
Constants ¶
View Source
const ( // PoolCount pool count PoolCount int = 2 // PoolTypeName pool type name PoolTypeName = 0 // PoolTypeHealth pool type health PoolTypeHealth = 1 )
Variables ¶
This section is empty.
Functions ¶
func GetQueueName ¶
GetQueueName Get Queue Name
func GetQueueNameByCluster ¶
GetQueueNameByCluster ...
func InitMQInitMachineryServerWorker ¶
func InitMQInitMachineryServerWorker( queueName string, invoke Invoke, redis *redis.Config, concurrencyNum int, errorsChan chan<- error, tracer opentracing.Tracer, logger logging.ILogger, ) (*machinery.Worker, error)
InitMQInitMachineryServerWorker initialize the machinary message queue service work.
func InitMachineryServer ¶
InitMachineryServer initialize Machinery service
func ReturnConn ¶
ReturnConn return connection
func SetLoggerLevel ¶
SetLoggerLevel set logger level
e.g.
if level.Level() > zapCore.DebugLevel { machinery.SetLoggerLevel(false) }
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer consumer
func NewConsumer ¶
func NewConsumer(redis *redis.Config, errorsChan chan<- error, tracer opentracing.Tracer, logger logging.ILogger) *Consumer
NewConsumer create new consumer object
type ConsumerUnit ¶
type ConsumerUnit struct {
// contains filtered or unexported fields
}
ConsumerUnit consumer unit
func NewConsumerUnit ¶
func NewConsumerUnit( logicWorker IWorker, redis *redis.Config, concurrentNum int, errorsChan chan<- error, tracer opentracing.Tracer, logger logging.ILogger, ) (*ConsumerUnit, error)
NewConsumerUnit create a new consumer unit
func (*ConsumerUnit) Resume ¶
func (unit *ConsumerUnit) Resume(errorsChan chan<- error)
Resume resume
type IWorker ¶
type IWorker interface { Work(ctx context.Context, taskType, taskData string) (string, error) GetQueueName() string Start() Stop() Release() error }
IWorker work interface
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger Logger
func NewMachineryLogger ¶
NewMachineryLogger -
Click to show internal directories.
Click to hide internal directories.