Documentation
¶
Index ¶
- type Broker
- type Pool
- type PriorityQueue
- type RedisConn
- func (rc *RedisConn) GetHashValue(key string, field string) (value string, retErr error)
- func (rc *RedisConn) GetZRangeByScoreLessThan(key string, number string) (valueArray []string, retErr error)
- func (rc *RedisConn) RemoveHash(key string, field string) (retErr error)
- func (rc *RedisConn) RemoveZSet(key string, valueArray []string) (retErr error)
- func (rc *RedisConn) SetHashValue(key string, field string, value string) (retErr error)
- type Task
- type TaskJSONType
- type TaskNode
- type TaskSetting
- type Worker
- type WorkerSetting
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker is broker struct
type Pool ¶
type Pool struct { TaskRetChan chan *taskRetData TaskRetWg sync.WaitGroup // contains filtered or unexported fields }
Pool is worker pool struct
func (*Pool) RegisterTaskFunction ¶
RegisterTaskFunction mapping
type PriorityQueue ¶ added in v0.0.3
type PriorityQueue []*TaskNode
PriorityQueue using minheap
func (PriorityQueue) Len ¶ added in v0.0.3
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶ added in v0.0.3
func (pq PriorityQueue) Less(next, current int) bool
func (*PriorityQueue) Pop ¶ added in v0.0.3
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶ added in v0.0.3
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶ added in v0.0.3
func (pq PriorityQueue) Swap(next, current int)
type RedisConn ¶
type RedisConn struct {
// contains filtered or unexported fields
}
RedisConn is redis connection struct
func NewRedisConn ¶
NewRedisConn create redis connection
func (*RedisConn) GetHashValue ¶
GetHashValue get hash value
func (*RedisConn) GetZRangeByScoreLessThan ¶
func (rc *RedisConn) GetZRangeByScoreLessThan(key string, number string) (valueArray []string, retErr error)
GetZRangeByScoreLessThan get ZSet values whose the score is less than number
func (*RedisConn) RemoveHash ¶
RemoveHash remove hash
func (*RedisConn) RemoveZSet ¶
RemoveZSet remove values from ZSet
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task struct
type TaskJSONType ¶
type TaskJSONType struct { Task string `json:"task"` Args json.RawMessage `json:"args"` Priority int `json:"priority"` }
TaskJSONType is register task json schema
type TaskNode ¶ added in v0.0.3
type TaskNode struct {
// contains filtered or unexported fields
}
TaskNode for PriorityQueue
type TaskSetting ¶
type TaskSetting struct {
// contains filtered or unexported fields
}
TaskSetting is a setting about task function mapping
func (*TaskSetting) Register ¶
func (ts *TaskSetting) Register(funcName string, function taskFuncType)
Register function mapping
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker is worker struct
func NewWorker ¶
func NewWorker(setting *WorkerSetting) *Worker
NewWorker will initialize a new worker
func (*Worker) RegisterTaskFunction ¶
RegisterTaskFunction mapping
Click to show internal directories.
Click to hide internal directories.