consumer

package
v0.0.0-...-4d53ac5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ModelAsyncBatch uint32 = 2 // 异步执行合并写
View Source
const ModelAsyncOne uint32 = 1 // 异步执行单条

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncConsumer

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

AsyncConsumer DB异步操作消费者

var (
	AsyncConsumerInstance *AsyncConsumer
)

func NewDbAsyncConsumer

func NewDbAsyncConsumer(dm *mongodb.Mgr, drm *db_retry.DBRetryMgr, bench *bench.DBAsync, workerChan <-chan interface{}) *AsyncConsumer

func (*AsyncConsumer) AsyncBatch

func (p *AsyncConsumer) AsyncBatch(ctx context.Context, funcArgList []*mongodb.FunctionArg, dbBatchMgr *db_batch.DbBatchMgr)

AsyncBatch 批量bulk write执行

func (*AsyncConsumer) AsyncOne

func (p *AsyncConsumer) AsyncOne(funcArg *mongodb.FunctionArg)

AsyncOne 单条执行

func (*AsyncConsumer) IsAsyncBatch

func (p *AsyncConsumer) IsAsyncBatch() bool

IsAsyncBatch 是否异步合并执行

func (*AsyncConsumer) IsAsyncOne

func (p *AsyncConsumer) IsAsyncOne() bool

IsAsyncOne 是否异步执行单条

func (*AsyncConsumer) Start

func (p *AsyncConsumer) Start()

Start 启动

func (*AsyncConsumer) Stop

func (p *AsyncConsumer) Stop()

Stop 关闭

func (*AsyncConsumer) SwitchMode

func (p *AsyncConsumer) SwitchMode(mode uint32)

SwitchMode 切换模式

Jump to

Keyboard shortcuts

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