Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Segment ¶
type Segment struct { Value *atomic.Int64 Max *atomic.Int64 Step *atomic.Int64 Buffer *SegmentBuffer }
func NewSegment ¶
func NewSegment(buffer *SegmentBuffer) *Segment
type SegmentBuffer ¶
type SegmentBuffer struct { Lock *sync.RWMutex Segments []*Segment //两个segment Key string NextReady bool InitOk *atomic.Bool ThreadRunning *atomic.Bool Step int64 MinStep int64 UpdateStamp int64 // contains filtered or unexported fields }
func NewSegmentBuffer ¶
func NewSegmentBuffer(key string) *SegmentBuffer
func (*SegmentBuffer) GetCurrent ¶
func (s *SegmentBuffer) GetCurrent() *Segment
func (*SegmentBuffer) IsInitOk ¶
func (s *SegmentBuffer) IsInitOk() bool
func (*SegmentBuffer) NextPos ¶
func (s *SegmentBuffer) NextPos() int
func (*SegmentBuffer) SetInitOK ¶
func (s *SegmentBuffer) SetInitOK(value bool)
func (*SegmentBuffer) SwitchPos ¶
func (s *SegmentBuffer) SwitchPos()
Click to show internal directories.
Click to hide internal directories.