@@ -12,6 +12,7 @@ go:
|
||||
- 1.14.x
|
||||
- 1.15.x
|
||||
- 1.16.x
|
||||
- 1.17.x
|
||||
|
||||
# Enable Go Modules
|
||||
env:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/alitto/pond/examples/dynamic_size
|
||||
|
||||
go 1.16
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/alitto/pond v1.5.1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/alitto/pond/examples/fixed_size
|
||||
|
||||
go 1.16
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/alitto/pond v1.5.1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/alitto/pond/examples/fixed_size
|
||||
|
||||
go 1.16
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/alitto/pond v1.5.1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/alitto/pond/examples/task_group
|
||||
|
||||
go 1.16
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/alitto/pond v1.5.1
|
||||
|
||||
@@ -141,16 +141,16 @@ func TestSubmitBefore(t *testing.T) {
|
||||
|
||||
// Submit a long-running task
|
||||
var doneCount int32
|
||||
pool.SubmitBefore(func() {
|
||||
time.Sleep(5 * time.Millisecond)
|
||||
pool.Submit(func() {
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
atomic.AddInt32(&doneCount, 1)
|
||||
}, 1*time.Millisecond)
|
||||
})
|
||||
|
||||
// Submit a task that times out after 2ms
|
||||
pool.SubmitBefore(func() {
|
||||
time.Sleep(5 * time.Millisecond)
|
||||
atomic.AddInt32(&doneCount, 1)
|
||||
}, 2*time.Millisecond)
|
||||
}, 5*time.Millisecond)
|
||||
|
||||
pool.StopAndWait()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user