core

package
v0.0.0-...-5be1c45 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

@Time : 2019-12-05 14:22 @Author : Lukebryan

@Time : 2019-12-05 14:22 @Author : Lukebryan

@Time : 2019-12-05 14:22 @Author : Lukebryan

@Time : 2019-12-05 14:22 @Author : Lukebryan

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleverCustomer

type CleverCustomer struct {
	Func func(interface{}) //自定义消费方法
	// contains filtered or unexported fields
}

场景:动态多Clever(),每个Clever为自定义数量并发

func NewCleverCustomer

func NewCleverCustomer(maxUseCount, timeOut int, f func(interface{})) CleverCustomer

新建并发协程 maxRunCount 并发量 f 自定义消费方法

func (*CleverCustomer) AddSmartData

func (c *CleverCustomer) AddSmartData(key string, data interface{})

添加数据至队列(数据入口)

func (*CleverCustomer) CheckTimeOut

func (c *CleverCustomer) CheckTimeOut(key string)

func (*CleverCustomer) Destroy

func (c *CleverCustomer) Destroy(key string)

销毁增Clever

func (*CleverCustomer) GetCleverSize

func (c *CleverCustomer) GetCleverSize() int

获取Clever数量

func (*CleverCustomer) GetSmartDataSize

func (c *CleverCustomer) GetSmartDataSize(key string) int

获取数据堆积量

func (*CleverCustomer) NewClever

func (c *CleverCustomer) NewClever(key string, smartRunCount int, f func(interface{})) error

新增Clever,默认单Clever

type CleverCustomers

type CleverCustomers struct {
	Func func([]interface{}) //自定义消费方法
	// contains filtered or unexported fields
}

场景:动态多Clever(),每个Clever为自定义数量并发

func NewCleverCustomers

func NewCleverCustomers(maxUseCount, maxDataGetCount, timeOut int, f func([]interface{})) CleverCustomers

新建并发协程 maxRunCount 并发量 f 自定义消费方法

func (*CleverCustomers) AddSmartDatas

func (c *CleverCustomers) AddSmartDatas(key string, datas []interface{})

添加数据至队列(数据入口)

func (*CleverCustomers) CheckTimeOut

func (c *CleverCustomers) CheckTimeOut(key string)

func (*CleverCustomers) Destroy

func (c *CleverCustomers) Destroy(key string)

销毁增Clever

func (*CleverCustomers) GetCleverSize

func (c *CleverCustomers) GetCleverSize() int

获取Clever数量

func (*CleverCustomers) GetSmartDataSize

func (c *CleverCustomers) GetSmartDataSize(key string) int

获取数据堆积量

func (*CleverCustomers) NewClevers

func (c *CleverCustomers) NewClevers(key string, smartRunCount, maxDataGetCount int, f func([]interface{})) error

新增Clever,默认单Clever

type RedisCustomers

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

场景:动态多Rediser(),每个Rediser为自定义数量并发 要求:Redis要求5.0以上

func NewRedisCustomers

func NewRedisCustomers(streamName string, maxDataGetCount int64, streamBlockTime time.Duration, RedisConfigs []utils.RedisConfig) (RedisCustomers, error)

新建Redis并发 maxRunCount 并发量 f 自定义消费方法

func (*RedisCustomers) GetData

func (r *RedisCustomers) GetData() []map[string]interface{}

func (*RedisCustomers) SetData

func (r *RedisCustomers) SetData(data map[string]interface{}) error

type SmartCustomer

type SmartCustomer struct {
	Func func(interface{}) //自定义消费方法
	// contains filtered or unexported fields
}

func NewSmartCustomer

func NewSmartCustomer(maxRunCount int, f func(interface{})) SmartCustomer

新建并发协程 maxRunCount 并发量 f 自定义消费方法

func (*SmartCustomer) AddDataQueue

func (s *SmartCustomer) AddDataQueue(data interface{})

添加数据至队列(数据入口)

func (*SmartCustomer) GetDataQueueSize

func (s *SmartCustomer) GetDataQueueSize() int

获取数据堆积量

func (*SmartCustomer) Stop

func (s *SmartCustomer) Stop()

type SmartCustomers

type SmartCustomers struct {
	Func func([]interface{}) //自定义消费方法
	// contains filtered or unexported fields
}

func NewSmartCustomers

func NewSmartCustomers(maxRunCount, maxDataGetCount int, f func([]interface{})) SmartCustomers

新建并发协程 maxRunCount 并发量 f 自定义消费方法

func (*SmartCustomers) AddDataQueues

func (s *SmartCustomers) AddDataQueues(datas []interface{})

添加数据至队列(数据入口)

func (*SmartCustomers) GetDataQueueSize

func (s *SmartCustomers) GetDataQueueSize() int

获取数据堆积量

func (*SmartCustomers) Stop

func (s *SmartCustomers) Stop()

Jump to

Keyboard shortcuts

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