MCPcopy Create free account
hub / github.com/CPChain/chain / put

Method put

protocols/cpc/syncer/queue.go:50–57  ·  view source on GitHub ↗
(task resultTask)

Source from the content-addressed store, hash-verified

48}
49
50func (q *queue) put(task resultTask) error {
51 if atomic.LoadInt32(&q.size) >= q.limit {
52 return ErrQueueFull
53 }
54 q.queue <- task
55 atomic.AddInt32(&q.size, 1)
56 return nil
57}
58
59func (q *queue) empty() bool {
60 return atomic.LoadInt32(&q.size) == 0

Callers 4

TestQueuePutAndGetFunction · 0.45
TestClearQueueFunction · 0.45
synchroniseMethod · 0.45
insertBlocksMethod · 0.45

Calls

no outgoing calls

Tested by 2

TestQueuePutAndGetFunction · 0.36
TestClearQueueFunction · 0.36