Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: clean up some comments and CI yaml #296

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ matrix.go }}-go-ci

- name: Run unit tests
- name: Run unit tests and integrated tests
run: go test -v -race -coverprofile="codecov.report" -covermode=atomic

- name: Upload code coverage report to Codecov
Expand Down
8 changes: 2 additions & 6 deletions pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ func (p *Pool) purgeStaleWorkers(ctx context.Context) {
staleWorkers[i] = nil
}

// There might be a situation where all workers have been cleaned up(no worker is running),
// while some invokers still are stuck in "p.cond.Wait()", then we need to awake those invokers.
// There might be a situation where all workers have been cleaned up (no worker is running),
// while some invokers still are stuck in p.cond.Wait(), then we need to awake those invokers.
if isDormant && p.Waiting() > 0 {
p.cond.Broadcast()
}
Expand Down Expand Up @@ -207,8 +207,6 @@ func NewPool(size int, options ...Option) (*Pool, error) {
return p, nil
}

// ---------------------------------------------------------------------------

// Submit submits a task to this pool.
//
// Note that you are allowed to call Pool.Submit() from the current Pool.Submit(),
Expand Down Expand Up @@ -321,8 +319,6 @@ func (p *Pool) Reboot() {
}
}

// ---------------------------------------------------------------------------

func (p *Pool) addRunning(delta int) {
atomic.AddInt32(&p.running, int32(delta))
}
Expand Down
8 changes: 2 additions & 6 deletions pool_func.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func (p *PoolWithFunc) purgeStaleWorkers(ctx context.Context) {
staleWorkers[i] = nil
}

// There might be a situation where all workers have been cleaned up(no worker is running),
// while some invokers still are stuck in "p.cond.Wait()", then we need to awake those invokers.
// There might be a situation where all workers have been cleaned up (no worker is running),
// while some invokers still are stuck in p.cond.Wait(), then we need to awake those invokers.
if isDormant && p.Waiting() > 0 {
p.cond.Broadcast()
}
Expand Down Expand Up @@ -213,8 +213,6 @@ func NewPoolWithFunc(size int, pf func(interface{}), options ...Option) (*PoolWi
return p, nil
}

//---------------------------------------------------------------------------

// Invoke submits a task to pool.
//
// Note that you are allowed to call Pool.Invoke() from the current Pool.Invoke(),
Expand Down Expand Up @@ -327,8 +325,6 @@ func (p *PoolWithFunc) Reboot() {
}
}

//---------------------------------------------------------------------------

func (p *PoolWithFunc) addRunning(delta int) {
atomic.AddInt32(&p.running, int32(delta))
}
Expand Down
Loading