Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOpt = JqOptions{ CocurrentWorkerNum: 10000, QueueCheckInterval: 100 * time.Millisecond, }
View Source
var ErrEmpty = errors.New("queue is empty")
View Source
var ErrNotExists = errors.New("queue not exists")
View Source
var ErrTimeout = errors.New("timeout")
Functions ¶
This section is empty.
Types ¶
type Jq ¶
type Jq struct {
// contains filtered or unexported fields
}
func NewJq ¶
func NewJq(name string, queueMgr QueueManager, workerFunc WorkerFunc) *Jq
func NewJqWithOpt ¶
func NewJqWithOpt(name string, queueMgr QueueManager, workerFunc WorkerFunc, opt JqOptions) *Jq
func NewMemJq ¶
func NewMemJq(name string, workerFunc WorkerFunc) *Jq
func (*Jq) DispatchForever ¶
func (jq *Jq) DispatchForever()
type MemQueueManager ¶
type MemQueueManager struct {
// contains filtered or unexported fields
}
func MemQueueManagerFactory ¶
func MemQueueManagerFactory(qfactory QueueFactory) *MemQueueManager
func (*MemQueueManager) Del ¶
func (self *MemQueueManager) Del(name string) error
func (*MemQueueManager) GetOrCreate ¶
func (self *MemQueueManager) GetOrCreate(name string) (Queue, error)
type QueueFactory ¶
type QueueManager ¶
type QueueManager interface { Exists(name string) (bool, error) Get(name string) (Queue, error) GetOrCreate(name string) (Queue, error) Del(name string) error }
func RedisQueueManagerFactory ¶
func RedisQueueManagerFactory(qfactory QueueFactory) QueueManager
type QueueManagerFactory ¶
type QueueManagerFactory func(QueueFactory) QueueManager
type RedisQueue ¶
type RedisQueue struct {
// contains filtered or unexported fields
}
func NewRedisQueue ¶
func NewRedisQueue(name string) *RedisQueue
func (*RedisQueue) Len ¶
func (q *RedisQueue) Len() int
func (*RedisQueue) Name ¶
func (q *RedisQueue) Name() string
func (*RedisQueue) Pop ¶
func (q *RedisQueue) Pop() ([]byte, error)
func (*RedisQueue) Push ¶
func (q *RedisQueue) Push(b []byte) error
type RedisQueueManager ¶
type RedisQueueManager struct {
// contains filtered or unexported fields
}
func (*RedisQueueManager) Del ¶
func (m *RedisQueueManager) Del(name string) error
func (*RedisQueueManager) GetOrCreate ¶
func (m *RedisQueueManager) GetOrCreate(name string) (Queue, error)
type WorkerFunc ¶
Click to show internal directories.
Click to hide internal directories.