MCPcopy Create free account
hub / github.com/RTradeLtd/Lens / Queue

Method Queue

engine/queue/queue.go:81–95  ·  view source on GitHub ↗

Queue indicates that a new item is pending insertion. A nil value indicates the item should be deleted.

(item *Item)

Source from the content-addressed store, hash-verified

79// Queue indicates that a new item is pending insertion. A nil value indicates
80// the item should be deleted.
81func (q *Queue) Queue(item *Item) error {
82 if item == nil || item.Key == "" {
83 return errors.New("item requires valid key")
84 }
85
86 q.smux.RLock()
87 if !q.stopped {
88 q.pendingC <- item
89 q.smux.RUnlock()
90 return nil
91 }
92 q.smux.RUnlock()
93 q.l.Error("queue failed: queue is stopped, cannot queue more elements")
94 return errors.New("queue is stopped, cannot queue more element")
95}
96
97// Run maintains the queue and executes flushes as necessary
98func (q *Queue) Run() {

Callers 3

IndexMethod · 0.80
RemoveMethod · 0.80
TestQueue_QueueFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestQueue_QueueFunction · 0.64