C# Класс Disruptor.SequenceGroup

A Sequence group that can dynamically have Sequences added and removed while being thread safe. The SequenceGroup.Value get and set methods are lock free and can be concurrently called with the SequenceGroup.Add and SequenceGroup.Remove.
Наследование: ISequence
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Add ( ISequence sequence ) : void

Add a Sequence into this aggregate. This should only be used during initialisation. Use SequenceGroup.AddWhileRunning.

AddAndGet ( long value ) : long
AddWhileRunning ( ICursored cursored, Sequence sequence ) : void

Adds a sequence to the sequence group after threads have started to publish to the Disruptor.It will set the sequences to cursor value of the ringBuffer just after adding them. This should prevent any nasty rewind/wrapping effects.

CompareAndSet ( long expectedSequence, long nextSequence ) : bool
IncrementAndGet ( ) : long
Remove ( ISequence sequence ) : bool

Remove the first occurrence of the Sequence from this aggregate.

SetValue ( long value ) : void

Set all Sequences in the group to a given value.

SetValueVolatile ( long value ) : void

Performs a volatile write of this sequence. The intent is a Store/Store barrier between this write and any previous write and a Store/Load barrier between this write and any subsequent volatile read.

Описание методов

Add() публичный Метод

Add a Sequence into this aggregate. This should only be used during initialisation. Use SequenceGroup.AddWhileRunning.
public Add ( ISequence sequence ) : void
sequence ISequence sequence to be added to the aggregate.
Результат void

AddAndGet() публичный Метод

public AddAndGet ( long value ) : long
value long
Результат long

AddWhileRunning() публичный Метод

Adds a sequence to the sequence group after threads have started to publish to the Disruptor.It will set the sequences to cursor value of the ringBuffer just after adding them. This should prevent any nasty rewind/wrapping effects.
public AddWhileRunning ( ICursored cursored, Sequence sequence ) : void
cursored ICursored The data structure that the owner of this sequence group will be pulling it's events from
sequence Sequence The sequence to add
Результат void

CompareAndSet() публичный Метод

public CompareAndSet ( long expectedSequence, long nextSequence ) : bool
expectedSequence long
nextSequence long
Результат bool

IncrementAndGet() публичный Метод

public IncrementAndGet ( ) : long
Результат long

Remove() публичный Метод

Remove the first occurrence of the Sequence from this aggregate.
public Remove ( ISequence sequence ) : bool
sequence ISequence sequence to be removed from this aggregate.
Результат bool

SetValue() публичный Метод

Set all Sequences in the group to a given value.
public SetValue ( long value ) : void
value long value to set the group of sequences to.
Результат void

SetValueVolatile() публичный Метод

Performs a volatile write of this sequence. The intent is a Store/Store barrier between this write and any previous write and a Store/Load barrier between this write and any subsequent volatile read.
public SetValueVolatile ( long value ) : void
value long
Результат void