<commit_before>package workerpool

// Job is the function which should be executed in worker.
type Job func()

type Pool struct {
	JobQueue chan Job
	d        *dispatcher
}

// New creates pool of workers.
// numWorkers - how many workers will be created for this pool
// queLen - how many jobs can we accept until we block
//
// Returned object contains JobQueue reference, which you can use to send job to pool.
func New(numWorkers int, queLen int) *Pool {
	jobQueue := make(chan Job, queLen)

	pool := &Pool{
		JobQueue: jobQueue,
		d:        newDispatcher(numWorkers, jobQueue),
	}

	return pool
}

// Will release resources used by pool
func (p *Pool) Stop() {
	p.d.stop()
}<commit_msg>Add/fix some comments on the exported methods<commit_after>package workerpool

// Job is the function which should be executed in worker.
type Job func()

// Pool contains all information for the pool instance.
// Exports JobQueue used to send jobs to the pool
type Pool struct {
	JobQueue chan Job
	d        *dispatcher
}

// New creates pool of workers.
// numWorkers - how many workers will be created for this pool
// queueLen - how many jobs can we accept until we block
//
// Returned object contains JobQueue reference, which you can use to send job to pool.
func New(numWorkers int, queueLen int) *Pool {
	jobQueue := make(chan Job, queueLen)

	pool := &Pool{
		JobQueue: jobQueue,
		d:        newDispatcher(numWorkers, jobQueue),
	}

	return pool
}

// Stop will stop the workers and release resources used by pool
func (p *Pool) Stop() {
	p.d.stop()
}
{'fraction_non_alphanumeric': 0.08376288659793814, 'fraction_numerical': 0.0, 'mean_word_length': 3.3259052924791086, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4676969', 'n_tokens_mistral': 467, 'n_tokens_neox': 452, 'n_words': 212}