Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config is a config of executor. ReqPerSeconds is request per seconds. If it is 0, no limit for requests. QueueSize is size of buffer. Executor use synchronize channel, publisher will waiting if channel is full. NumWorkers is a number of goroutine.
type Executor ¶
type Executor struct { RateLimit ratelimit.Limiter WaitGroup *sync.WaitGroup Channel chan *Job NumWorkers int }
Executor is a simple thread pool base on goroutine.
func (*Executor) Publish ¶
Publish to publish a handler and arguments Workers will run handler with provided arguments.
func (*Executor) PublishJob ¶
PublishJob publish a provided job.
Click to show internal directories.
Click to hide internal directories.