()
| 46 | } |
| 47 | |
| 48 | func ExampleListQueue() { |
| 49 | q := NewListQueue(10) |
| 50 | q.Run() |
| 51 | |
| 52 | var count int64 |
| 53 | for i := 0; i < 10; i++ { |
| 54 | job := NewJob("foo", func(v interface{}) { |
| 55 | atomic.AddInt64(&count, 1) |
| 56 | }) |
| 57 | q.Push(job) |
| 58 | } |
| 59 | |
| 60 | q.Terminate() |
| 61 | fmt.Println(count) |
| 62 | // output: 10 |
| 63 | } |
| 64 | |
| 65 | func BenchmarkListQueue(b *testing.B) { |
| 66 | q := NewListQueue(100) |
nothing calls this directly
no test coverage detected