(now time.Time, timeout time.Duration)
| 1210 | } |
| 1211 | |
| 1212 | func newWriteBatch(now time.Time, timeout time.Duration) *writeBatch { |
| 1213 | return &writeBatch{ |
| 1214 | time: now, |
| 1215 | ready: make(chan struct{}), |
| 1216 | done: make(chan struct{}), |
| 1217 | timer: time.NewTimer(timeout), |
| 1218 | } |
| 1219 | } |
| 1220 | |
| 1221 | func (b *writeBatch) add(msg Message, maxSize int, maxBytes int64) bool { |
| 1222 | bytes := int64(msg.totalSize()) |
no outgoing calls