|
@@ -136,7 +136,7 @@ func (m *BufferMap) Clear() {
|
|
|
type BufferPostman struct {
|
|
|
limit int
|
|
|
duration time.Duration
|
|
|
- buffer *BufferMap
|
|
|
+ Buffer *BufferMap
|
|
|
timer *time.Timer
|
|
|
isTimerStop bool
|
|
|
target chan interface{}
|
|
@@ -147,7 +147,7 @@ func NewBufferPostman(limit int, duration time.Duration, target chan interface{}
|
|
|
p := &BufferPostman{
|
|
|
limit: limit,
|
|
|
duration: duration,
|
|
|
- buffer: NewBufferMap(),
|
|
|
+ Buffer: NewBufferMap(),
|
|
|
target: target,
|
|
|
}
|
|
|
if duration > 0 {
|
|
@@ -167,7 +167,7 @@ func NewBufferPostman(limit int, duration time.Duration, target chan interface{}
|
|
|
|
|
|
// 置入消息
|
|
|
func (p *BufferPostman) Push(item IBufferItem) {
|
|
|
- size := p.buffer.Push(item)
|
|
|
+ size := p.Buffer.Push(item)
|
|
|
if p.isTimerStop { // 唤醒定时器
|
|
|
p.resetTimer()
|
|
|
}
|
|
@@ -178,7 +178,7 @@ func (p *BufferPostman) Push(item IBufferItem) {
|
|
|
|
|
|
// 投递消息
|
|
|
func (p *BufferPostman) deliver() {
|
|
|
- data := p.buffer.PopAll()
|
|
|
+ data := p.Buffer.PopAll()
|
|
|
if nil != data && len(data) > 0 {
|
|
|
// 仅供测试时用的日志记录
|
|
|
//if eventType == 1 {
|