Files
Michael McGuinness 752fb2e2c0 Merged in feature/chc_1 (pull request #120)
Text Extraction Clean Up + Parallelization

* merged_Call

* directchildren

* bitofimprovements

* go

* parallel

* fixfullsuite

* pondforconcurrency

* comments

* muchdone

* bitsofclean

* stabilisedtests

* snappy

* threadpooltests

* childelements

* testspassed
2025-04-25 17:02:50 +00:00

30 lines
613 B
Go

package pond
import (
"context"
)
type Option func(*pool)
// WithContext sets the context for the pool.
func WithContext(ctx context.Context) Option {
return func(p *pool) {
p.ctx = ctx
}
}
// WithQueueSize sets the max number of elements that can be queued in the pool.
func WithQueueSize(size int) Option {
return func(p *pool) {
p.queueSize = size
}
}
// WithNonBlocking sets the pool to be non-blocking when the queue is full.
// This option is only effective when the queue size is set.
func WithNonBlocking(nonBlocking bool) Option {
return func(p *pool) {
p.nonBlocking = nonBlocking
}
}