Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CoarseTimeNow ¶
CoarseTimeNow returns the current time truncated to the nearest second.
This is a faster alternative to time.Now().
Types ¶
type WorkerPool ¶
type WorkerPool struct {
MaxWorkersCount int
MaxIdleWorkerDuration time.Duration
// contains filtered or unexported fields
}
WorkerPool serves outgoing connections via a pool of workers in FILO order, i.e. the most recently stopped worker will serve the next incoming connection.
Such a scheme keeps CPU caches hot (in theory).
func (*WorkerPool) Go ¶
func (wp *WorkerPool) Go(c func()) bool
func (*WorkerPool) Start ¶
func (wp *WorkerPool) Start()
func (*WorkerPool) Stop ¶
func (wp *WorkerPool) Stop()
Click to show internal directories.
Click to hide internal directories.