Documentation ¶
Overview ¶
threading package provides support for simple concurrency and threading
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ThreadPool ¶
type ThreadPool struct {
// contains filtered or unexported fields
}
func NewThreadPool ¶
func (*ThreadPool) AddJob ¶
func (t *ThreadPool) AddJob(job Job)
AddJob adds a job to the thread pool. It increases the wait group counter and sends the job to the jobs channel.
func (*ThreadPool) PendingJobs ¶
func (t *ThreadPool) PendingJobs() int
PendingJobs returns the number of jobs that are pending.
func (*ThreadPool) ProcessAndWait ¶
func (t *ThreadPool) ProcessAndWait() error
ProcessAndWait blocks until all jobs have finished. If no jobs were added, it returns an error.
Click to show internal directories.
Click to hide internal directories.