Versions in this module Expand all Collapse all v1 v1.1.0 Mar 14, 2026 Changes in this version + const CacheLineBytes + var ErrCapacityUnavailable = errors.New("seqflow: capacity unavailable") + var ErrClosed = errors.New("seqflow: disruptor is closed") + var ErrCyclicDependency = errors.New("seqflow: cyclic dependency detected") + var ErrDuplicateHandler = errors.New("seqflow: duplicate handler name") + var ErrInvalidCapacity = errors.New("seqflow: capacity must be a positive power of 2") + var ErrInvalidReservation = errors.New("seqflow: invalid reservation size (zero or exceeds capacity)") + var ErrNoHandlers = errors.New("seqflow: at least one handler is required") + var ErrUnknownDependency = errors.New("seqflow: unknown dependency in DependsOn") + type BlockingStrategy struct + func NewBlockingStrategy() *BlockingStrategy + func (s *BlockingStrategy) Gate(int64) + func (s *BlockingStrategy) Idle(int64) + func (s *BlockingStrategy) Reserve(int64) + func (s *BlockingStrategy) Signal() + type BusySpinStrategy struct + func NewBusySpinStrategy() *BusySpinStrategy + func (s *BusySpinStrategy) Gate(int64) + func (s *BusySpinStrategy) Idle(int64) + func (s *BusySpinStrategy) Reserve(int64) + func (s *BusySpinStrategy) Signal() + type Disruptor struct + func New[T any](opts ...Option) (*Disruptor[T], error) + func (d *Disruptor[T]) Close() error + func (d *Disruptor[T]) Commit(lower, upper int64) + func (d *Disruptor[T]) Drain(ctx context.Context) error + func (d *Disruptor[T]) Listen() + func (d *Disruptor[T]) Reserve(count uint32) (int64, error) + func (d *Disruptor[T]) RingBuffer() *RingBuffer[T] + func (d *Disruptor[T]) TryReserve(count uint32) (int64, error) + type Handler interface + Handle func(lower, upper int64) + type HandlerOption func(*handlerNode) + func DependsOn(names ...string) HandlerOption + type Metrics interface + BufferUsage func(used, capacity int64) + CommitCount func(count int64) + GateCount func(name string, count int64) + HandleCount func(name string, count int64) + HandleEvents func(name string, count int64) + IdleCount func(name string, count int64) + ReserveCount func(count int64) + ReserveWaitCount func(count int64) + type NoopMetrics struct + func (NoopMetrics) BufferUsage(used, capacity int64) + func (NoopMetrics) CommitCount(int64) + func (NoopMetrics) GateCount(string, int64) + func (NoopMetrics) HandleCount(string, int64) + func (NoopMetrics) HandleEvents(string, int64) + func (NoopMetrics) IdleCount(string, int64) + func (NoopMetrics) ReserveCount(int64) + func (NoopMetrics) ReserveWaitCount(int64) + type Option func(*config) + func WithCapacity(n uint32) Option + func WithHandler(name string, h Handler, opts ...HandlerOption) Option + func WithMetrics(m Metrics) Option + func WithWaitStrategy(ws WaitStrategy) Option + func WithWriterCount(n uint8) Option + type RingBuffer struct + func NewRingBuffer[T any](capacity uint32) (*RingBuffer[T], error) + func (rb *RingBuffer[T]) Capacity() uint32 + func (rb *RingBuffer[T]) Get(seq int64) *T + func (rb *RingBuffer[T]) Set(seq int64, value T) + type SequenceBarrier interface + Load func(lower int64) int64 + type SleepingStrategy struct + func NewSleepingStrategy() *SleepingStrategy + func (s *SleepingStrategy) Gate(int64) + func (s *SleepingStrategy) Idle(int64) + func (s *SleepingStrategy) Reserve(int64) + func (s *SleepingStrategy) Signal() + type WaitStrategy interface + Gate func(count int64) + Idle func(count int64) + Reserve func(count int64) + Signal func() + type YieldingStrategy struct + func NewYieldingStrategy() *YieldingStrategy + func (s *YieldingStrategy) Gate(int64) + func (s *YieldingStrategy) Idle(int64) + func (s *YieldingStrategy) Reserve(int64) + func (s *YieldingStrategy) Signal()