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 ¶
- type CleverCustomer
- func (c *CleverCustomer) AddSmartData(key string, data interface{})
- func (c *CleverCustomer) CheckTimeOut(key string)
- func (c *CleverCustomer) Destroy(key string)
- func (c *CleverCustomer) GetCleverSize() int
- func (c *CleverCustomer) GetSmartDataSize(key string) int
- func (c *CleverCustomer) NewClever(key string, smartRunCount int, f func(interface{})) error
- type CleverCustomers
- func (c *CleverCustomers) AddSmartDatas(key string, datas []interface{})
- func (c *CleverCustomers) CheckTimeOut(key string)
- func (c *CleverCustomers) Destroy(key string)
- func (c *CleverCustomers) GetCleverSize() int
- func (c *CleverCustomers) GetSmartDataSize(key string) int
- func (c *CleverCustomers) NewClevers(key string, smartRunCount, maxDataGetCount int, f func([]interface{})) error
- type RedisCustomers
- type SmartCustomer
- type SmartCustomers
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) GetSmartDataSize ¶
func (c *CleverCustomer) GetSmartDataSize(key string) int
获取数据堆积量
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) 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) 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) Stop ¶
func (s *SmartCustomers) Stop()
Click to show internal directories.
Click to hide internal directories.