Documentation ¶
Overview ¶
Package syncsort provides support for synchronised sorting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item[T any] struct { V T // contains filtered or unexported fields }
Item represents a single item in a stream that is to be ordered. It is returned by NextItem and simply wraps the supplied type with a monotonically increasing sequence number that determines its position in the ordered stream. This sequence number is assigned by NextItem.
type Sequencer ¶
type Sequencer[T any] struct { // contains filtered or unexported fields }
Sequencer implements a streaming sequencer that will accept a stream of unordered items (sent to it over a channel) and allow for that stream to scanned in order. The end of the unordered stream is signaled by closing this chanel. Items to be sent in the stream are obtained via calls to NextItem and the order of calls to NextItem determines the order of items returned by the scanner.
func NewSequencer ¶
NewSequencer returns a new instance of Sequencer.
func (*Sequencer[T]) Item ¶
func (s *Sequencer[T]) Item() T
Item returns the current item available in the scanner.