Documentation ¶
Index ¶
- type Work
- func (p *Work) AfterPost(d time.Duration, f func()) *time.Timer
- func (p *Work) Close()
- func (p *Work) Len() int
- func (p *Work) NewTicker(d time.Duration, f func()) io.Closer
- func (p *Work) NewTryTicker(d time.Duration, maxLen int, f func()) *time.Ticker
- func (p *Work) Post(f func())
- func (p *Work) Run()
- func (p *Work) TryPost(f func(), maxLen int)
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Work ¶
type Work struct {
// contains filtered or unexported fields
}
TODO 这里的实现 chan如果塞满会阻塞进程,可对比参照github.com/davyxu/cellnet EventQueue实现,选方案
func (*Work) NewTryTicker ¶
worker长度超过maxLen就丢弃f
Click to show internal directories.
Click to hide internal directories.