Skip to content

Releases: disruptor-net/Disruptor-net

6.0.0

13 Jan 18:15
Compare
Choose a tag to compare
  • Add MaxBatchSize to all event handler interfaces (IEventHandler, IBatchEventHandler, IValueEventHandler, IAsyncBatchEventHandler)
  • Refactor event processor factories (breaking change)

The factory method now takes a SequenceBarrier instead of a ISequence[]. The factory implementations always had to create a sequence barrier anyway so the new API should be simpler is to use. Also, the factory types are now delegates instead of interfaces, so they can be created using lambdas, which was probably the design goal of the Java API.

  • Remove ISequence (breaking change)

The codebase was no longer creating any implementation other than Sequence. Thus, ISequence was an unnecessary abstraction which was not even useful for encapsulation because it was mutable.

  • Remove the obsolete method RingBuffer.ResetTo (breaking change)
  • Remove LiteTimeoutBlockingWaitStrategy (breaking change)
  • Pass DependentSequenceGroup in sequence barrier constructor (breaking change)
  • Add tag to DependentSequenceGroup

The goal of the tag is to allow wait strategies to identify specific sequence groups to apply different wait logic.

  • Add HybridSpinWaitStrategy

It is a non-blocking strategy that uses either AggressiveSpinWait or SpinWait depending on the target DependentSequenceGroup. Although this wait strategy is useful and functional, it was mainly added as an example of a wait strategy that applies different wait logic depending on the sequence groups tags.

5.0.0

28 Sep 12:43
Compare
Choose a tag to compare

The V5 is clearly a major version, with the addition of two new event handler interfaces, the support of Task based event consumers, and the refactoring of the wait strategy API. A few changes were ported from the Java version, the more important being the removal of event handling extension interfaces. However, many changes are .NET specific and some of them tend move the API away from the Java version in order to turn it into idiomatic .NET.

For the detailed changelog, see:

5.0.0-rc2

14 May 16:32
Compare
Choose a tag to compare
5.0.0-rc2 Pre-release
Pre-release

The RC2 is the last release of 5.0.0 that includes new features.

See RC1 changes.

Major

  • Add AsyncEventStream

AsyncEventStream is a new async poll-based API:

var stream = ringBuffer.NewAsyncEventStream();

await foreach (var batch in stream.ConfigureAwait(false))
{
    foreach (var evt in batch)
    {
        // process event
    }
}
  • Remove unused members from ISequence (breaking change)
  • Use DependentSequenceGroup in IWaitStrategy (breaking change)

The wait strategy API was refactored to use DependentSequenceGroup instead of the sequence couple Sequence cursor, ISequence dependentSequence. This change makes the API more explicit, avoid exposing mutable sequences to wait strategies and slightly improves performance.

  • Replace Disruptor.GetBarrierFor by Disruptor.GetDependentSequencesFor

Sequence barriers are stateful components which are dangerous to expose, but they were the only option to identify the source processor in a wait strategy and track the dependent sequences of a given processor. Exposing the dependent sequences instead of the barrier seems to
address both issues.

  • Remove obsolete Disruptor.HandleExceptionsWith (breaking change)
  • Remove sequence barrier interfaces (breaking change)

Minor

  • Make all wait strategies sealed
  • Handle explicit OnBatchStart implementations by @ltrzesniewski (#62).
  • A few performance improvements (including #61 by @buybackoff).

5.0.0-rc1

22 Jan 17:39
Compare
Choose a tag to compare
5.0.0-rc1 Pre-release
Pre-release

Major

  • Drop net452 and netstandard2.0 target frameworks (breaking change)
  • Remove ILifecycleAware (breaking change) Move methods to event handler interfaces with default implementations
  • Remove ITimeoutHandler (breaking change) Move OnTimeout to event handler interfaces with default implementation
  • Remove IBatchStartAware (breaking change) Move OnBatchStart to event handler interfaces with default implementation
  • Refactor IWaitStrategy (breaking change)

IWaitStrategy now uses the standard .NET cancellation type instead of ISequenceBarrier.
IWaitStrategy also returns a SequenceWaitResult which makes the fact that wait strategies can timeout more explicit..

SequenceWaitResult WaitFor(long sequence, Sequence cursor, ISequence dependentSequence, CancellationToken cancellationToken);

If you implemented custom wait strategies, you can simply replace barrier.CheckAlert() with cancellationToken.ThrowIfCancellationRequested().

  • New event handler: IBatchEventHandler<T>

IBatchEventHandler is a new event handler which has a batch oriented API:

public interface IBatchEventHandler<T>
{
    void OnBatch(EventBatch<T> batch, long sequence);
}

This handler has better performance than the default IEventHandler<T> for processing batches of multiple events.
It is also much more convenient for explicit batch management.

  • New event handler: IAsyncBatchEventHandler<T>

IAsyncBatchEventHandler is a new event handler which has a async oriented API:

public interface IAsyncBatchEventHandler<T>
{
    ValueTask OnBatch(EventBatch<T> batch, long sequence);
}

This event handler is quite unique because:

  • The processing of this handler can generate heap allocations.
  • The processing of this handler runs on thread-pool threads (other handlers runs on dedicated threads).

It is intended to be used in applications that can accept a reasonable amount of heap allocations and that use async APIs to process events.

Minor

  • Enable null reference analysis

  • Support batch handlers in EventPoller

  • Add dedicated exception handling method for batches (breaking change)

  • Add dedicated exception handling method for timeouts (breaking change)

  • Replace Run by Start in IEventProcessor (breaking change)

  • Remove IExecutor (breaking change)

IExecutor was a port of java.util.concurrent.Executor which was used to start event processor tasks.
Event processor tasks are now started directly using a TaskScheduler.
If you used the Disruptor constructor that was IExecutor-based, you can simply use the TaskScheduler-based constructor instead.
If you implemented a custom IExecutor, you can implement a custom TaskScheduler instead.

  • Use a pointer in MultiProducerSequencer (performance)

MultiProducerSequencer now uses a POH (pinned object heap) allocated array to remove array bound checks (net5.0+ only).

  • Replace INonBlockingWaitStrategy by IWaitStrategy.IsBlockingStrategy (breaking change)
  • Replace CAS loop by Interlocked.Add in MultiProducerSequencer (performance)
  • Add a property to check if disruptor has been started
  • Replace IsPublished with IsAvailable on RingBuffer (breaking change)
  • Move event processors to Processing namespace (breaking change)
  • Make ConsumerRepository related types internal (breaking change)
  • Remove TimeoutException (breaking change)
  • Remove AlertException (breaking change)
  • Remove NoOpEventProcessor (breaking change)
  • Rename default event processor (breaking change) Make event processor names matching event handler names

In addition, this version includes a few micro-optimization from @buybackoff.

4.0.0

19 Dec 18:34
Compare
Choose a tag to compare
  • Enable assembly signing
  • Move PollState to EventPoller.PollState to match Java version (Breaking Change)
  • Add event poller for ValueRingBuffer
  • Remove obsolete publication API (Breaking Change)

3.6.2

20 Feb 11:05
Compare
Choose a tag to compare
  • Fix ring buffers indexers on mono

3.6.1

10 Jan 15:33
Compare
Choose a tag to compare
  • Improve RingBuffer and ValueRingBuffer indexers performance for netcoreapp

3.6.0

08 Jan 09:43
Compare
Choose a tag to compare
  • Add UnmanagedDisruptor
  • Support IEventProcessorSequenceAware for value event handlers
  • Remove Sequencer

3.5.0

08 Jan 09:43
Compare
Choose a tag to compare
  • Add ValueDisruptor
  • Add new publication API
  • Make event translators obsolete

3.4.2

08 Jan 09:42
Compare
Choose a tag to compare
  • Stop invoking IBatchStartAware.OnBatchStart for empty batches
  • Support event handlers with explicit interface implementations