 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- type EnhancedQueue
- func (eq *EnhancedQueue) Add(key string, priority int64, creationTime time.Time)
- func (eq *EnhancedQueue) Export() json.RawMessage
- func (eq *EnhancedQueue) Import(rawMsg json.RawMessage) error
- func (eq *EnhancedQueue) InPending(key string) bool
- func (eq *EnhancedQueue) InProcessing(key string) bool
- func (eq *EnhancedQueue) InQueue(key string) bool
- func (eq *EnhancedQueue) PendingQueue() *priorityqueue.PriorityQueue
- func (eq *EnhancedQueue) PopPending(dryRun ...bool) string
- func (eq *EnhancedQueue) PopPendingKey(key string, dryRun ...bool) string
- func (eq *EnhancedQueue) PopProcessing(key string, dryRun ...bool) string
- func (eq *EnhancedQueue) ProcessingQueue() *priorityqueue.PriorityQueue
- func (eq *EnhancedQueue) ProcessingWindow() int64
- func (eq *EnhancedQueue) RangePending(f func(priorityqueue.Item) bool)
- func (eq *EnhancedQueue) SetProcessingWindow(newWindow int64)
 
- type SnapshotObj
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnhancedQueue ¶
type EnhancedQueue struct {
	// contains filtered or unexported fields
}
    EnhancedQueue 在优先队列基础上进行了封装,功能增强
func NewEnhancedQueue ¶
func NewEnhancedQueue(window int64) *EnhancedQueue
func (*EnhancedQueue) Add ¶
func (eq *EnhancedQueue) Add(key string, priority int64, creationTime time.Time)
Add 将指定 key 插入 pending 队列
func (*EnhancedQueue) Export ¶
func (eq *EnhancedQueue) Export() json.RawMessage
func (*EnhancedQueue) Import ¶
func (eq *EnhancedQueue) Import(rawMsg json.RawMessage) error
func (*EnhancedQueue) InPending ¶
func (eq *EnhancedQueue) InPending(key string) bool
InPending 返回指定 key 是否在等待中
func (*EnhancedQueue) InProcessing ¶
func (eq *EnhancedQueue) InProcessing(key string) bool
InProcessing 返回指定 key 是否正在处理中
func (*EnhancedQueue) InQueue ¶
func (eq *EnhancedQueue) InQueue(key string) bool
InQueue 返回指定 key 是否在某一具体队列中
func (*EnhancedQueue) PendingQueue ¶
func (eq *EnhancedQueue) PendingQueue() *priorityqueue.PriorityQueue
func (*EnhancedQueue) PopPending ¶
func (eq *EnhancedQueue) PopPending(dryRun ...bool) string
PopPending 将 pending 中的第一个 key 推进到 processing 返回被 pop 的 key
func (*EnhancedQueue) PopPendingKey ¶
func (eq *EnhancedQueue) PopPendingKey(key string, dryRun ...bool) string
PopPendingKey pop specified key to processing queue.
func (*EnhancedQueue) PopProcessing ¶
func (eq *EnhancedQueue) PopProcessing(key string, dryRun ...bool) string
PopProcessing 将指定 key 从 processing 队列中移除,表示完成
func (*EnhancedQueue) ProcessingQueue ¶
func (eq *EnhancedQueue) ProcessingQueue() *priorityqueue.PriorityQueue
func (*EnhancedQueue) ProcessingWindow ¶
func (eq *EnhancedQueue) ProcessingWindow() int64
func (*EnhancedQueue) RangePending ¶
func (eq *EnhancedQueue) RangePending(f func(priorityqueue.Item) bool)
func (*EnhancedQueue) SetProcessingWindow ¶
func (eq *EnhancedQueue) SetProcessingWindow(newWindow int64)
type SnapshotObj ¶
type SnapshotObj struct {
	Pending          json.RawMessage `json:"pending"`
	Processing       json.RawMessage `json:"processing"`
	ProcessingWindow int64           `json:"processingWindow"`
}
     Click to show internal directories. 
   Click to hide internal directories.