Added method to determine the highest committed sequence in a multi-producer scenario.
diff --git a/multi_writer.go b/multi_writer.go
index bcdf404..010b96d 100644
--- a/multi_writer.go
+++ b/multi_writer.go
@@ -70,9 +70,12 @@
}
}
-func (this *MultiWriter) Claimed() *Cursor {
- return this.claimed
-}
-func (this *MultiWriter) Buffer() []int32 {
- return this.committed
+func (this *MultiWriter) LoadBarrier(lower, upper int64) int64 {
+ for mask := this.capacity - 1; lower <= upper; lower++ {
+ if this.committed[lower&mask] < int32(lower>>this.shift) {
+ return lower - 1
+ }
+ }
+
+ return upper
}