Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7724583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:43:33+00:00 2026-06-01T04:43:33+00:00

I am trying to learn how to use the Disruptor.NET messaging framework, and I

  • 0

I am trying to learn how to use the Disruptor.NET messaging framework, and I can’t find any practical examples. There are quite a few articles out there with pictures about how it works, but I can’t find anywhere that actually goes and shows you how to implement the methods. What would be an example?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:43:35+00:00Added an answer on June 1, 2026 at 4:43 am

    Frustrated that I couldn’t find a workable ‘Hello World’ for Disruptor-net, I fiddled around until I got one working. See below. The Console.WriteLine lines are handy for seeing how things work. For example, the RingBuffer creates each entry instance at start-up (which makes sense).

    Hopefully this helps anyone looking for help with Disruptor on .NET.

    using System;
    using System.Linq;
    using System.Threading;
    using System.Threading.Tasks;
    using Disruptor;
    using Disruptor.Dsl;
    
    namespace DisruptorTest
    {
        public sealed class ValueEntry
        {
            public long Value { get; set; }
    
            public ValueEntry()
            {
                Console.WriteLine("New ValueEntry created");
            }
        }
    
        public class ValueAdditionHandler : IEventHandler<ValueEntry>
        {
            public void OnNext(ValueEntry data, long sequence, bool endOfBatch)
            {
                Console.WriteLine("Event handled: Value = {0} (processed event {1}", data.Value, sequence);
            }
        }
    
        class Program
        {
            private static readonly Random _random = new Random();
            private static readonly int _ringSize = 16;  // Must be power of 2
    
            static void Main(string[] args)
            {
                var disruptor = new Disruptor.Dsl.Disruptor<ValueEntry>(() => new ValueEntry(), _ringSize, TaskScheduler.Default);    
                disruptor.HandleEventsWith(new ValueAdditionHandler());    
                var ringBuffer = disruptor.Start();    
                while (true)
                {
                    long sequenceNo = ringBuffer.Next();    
                    ValueEntry entry = ringBuffer[sequenceNo];    
                    entry.Value = _random.Next();    
                    ringBuffer.Publish(sequenceNo);    
                    Console.WriteLine("Published entry {0}, value {1}", sequenceNo, entry.Value);    
                    Thread.Sleep(250);
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to learn how to use lift. I can create project skeleton by
I am trying to learn how to use the ASP.NET Menu control. The MSDN
I am trying to learn how to use MSBuild so we can use it
I am trying to learn and use an SDK for a vendor's product. Unfortunately,
I am trying to learn to use buffer overflow attack in Ubuntu. Unfortunately, I
I am trying to learn to use the wx packages to make GUI programs
I am relatively new to programming, and I am trying to learn to use
I'm trying to learn how to use oop in php. I'm also fairly new
I'm trying to learn how to use actionscript over mxml for flexibility. I have
I'm trying to learn how to use the UITableView in conjunction with a SQLite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.