Pull get a node from queue it will add the working count and blocked when there are no node on queue but working count not zero
()
| 57 | // Pull get a node from queue |
| 58 | // it will add the working count and blocked when there are no node on queue but working count not zero |
| 59 | func (q *Queue) Pull() QueueNode { |
| 60 | q.mux.Lock() |
| 61 | defer q.mux.Unlock() |
| 62 | node := q.PullWithOutLock() |
| 63 | if node != nil { |
| 64 | return node |
| 65 | } else { |
| 66 | return nil |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | func (q *Queue) PullWithWorkingBlock() QueueNode { |
| 71 | q.mux.Lock() |