mirror of
https://github.com/fumiama/orbyte.git
synced 2026-06-06 02:30:30 +08:00
feat: add async conflict detection
This commit is contained in:
@@ -10,23 +10,19 @@ import (
|
||||
func (bufferPool BufferPool[USRDAT]) NewBuffer(
|
||||
buf []byte,
|
||||
) *orbyte.Item[UserBuffer[USRDAT]] {
|
||||
return bufferPool.p.New(buf)
|
||||
return bufferPool.New(buf)
|
||||
}
|
||||
|
||||
// InvolveBuffer involve external *bytes.Buffer into Item.
|
||||
func (bufferPool BufferPool[USRDAT]) InvolveBuffer(
|
||||
buf *bytes.Buffer,
|
||||
) *orbyte.Item[UserBuffer[USRDAT]] {
|
||||
return bufferPool.p.Involve(buf.Len(), buf)
|
||||
return bufferPool.Involve(buf.Len(), buf)
|
||||
}
|
||||
|
||||
// ParseBuffer convert external *bytes.Buffer into Item.
|
||||
func (bufferPool BufferPool[USRDAT]) ParseBuffer(
|
||||
buf *bytes.Buffer,
|
||||
) *orbyte.Item[UserBuffer[USRDAT]] {
|
||||
return bufferPool.p.Parse(buf.Len(), buf)
|
||||
}
|
||||
|
||||
func (bufferPool BufferPool[USRDAT]) CountItems() (outside int32, inside int32) {
|
||||
return bufferPool.p.CountItems()
|
||||
return bufferPool.Parse(buf.Len(), buf)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user