Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NaiveWorker ¶
type NaiveWorker struct {
// contains filtered or unexported fields
}
NaiveWorker is a naive implementation of the Worker interface
type NaiveWorkerPool ¶
type NaiveWorkerPool struct {
// contains filtered or unexported fields
}
NaiveWorkerPool provides a naive implementation of the worker pool interface
func Create ¶
func Create(initialSize uint64, maxSize uint64) *NaiveWorkerPool
Create a naive worker pool with the specified initial and max size
func (*NaiveWorkerPool) Dispose ¶
func (nwp *NaiveWorkerPool) Dispose()
Dispose shuts down the worker pool, but waits for all work to finish
func (*NaiveWorkerPool) IsDisposed ¶
func (nwp *NaiveWorkerPool) IsDisposed() bool
IsDisposed checks if the pool has been disposed
func (*NaiveWorkerPool) IsDisposing ¶
func (nwp *NaiveWorkerPool) IsDisposing() bool
IsDisposing checks if the pool is currently disposing/shutting down
func (*NaiveWorkerPool) Submit ¶
func (nwp *NaiveWorkerPool) Submit(workerFunc func())
Submit work to the worker pool. Work will not be submitted if the pool is shutting down or shut down.
type Worker ¶
type Worker interface {
// contains filtered or unexported methods
}
Worker provides a standard worker interface for the worker pool
type WorkerPool ¶
type WorkerPool interface {
Submit(work func())
Dispose()
IsDisposing() bool
IsDisposed() bool
// contains filtered or unexported methods
}
WorkerPool is a simple thread safe worker pool
Click to show internal directories.
Click to hide internal directories.