C# Class 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.
Inheritance: ISequence
Afficher le fichier Open project: disruptor-net/Disruptor-net Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

Add() public méthode

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.
Résultat void

AddAndGet() public méthode

public AddAndGet ( long value ) : long
value long
Résultat long

AddWhileRunning() public méthode

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
Résultat void

CompareAndSet() public méthode

public CompareAndSet ( long expectedSequence, long nextSequence ) : bool
expectedSequence long
nextSequence long
Résultat bool

IncrementAndGet() public méthode

public IncrementAndGet ( ) : long
Résultat long

Remove() public méthode

Remove the first occurrence of the Sequence from this aggregate.
public Remove ( ISequence sequence ) : bool
sequence ISequence sequence to be removed from this aggregate.
Résultat bool

SetValue() public méthode

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.
Résultat void

SetValueVolatile() public méthode

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
Résultat void