← Back to all articles

Introducing MyChannels.Nirvana

Overview

Over the past three Months I’ve been working closely with the guys at my-Channels on a new .NET API for Nirvana. There was a general consensus that, being a Java port, the existing API was not a friendly development experience for people coming from a .NET background. In an ideal world we decided that we’d like to;

  1. Provide a surface area that would be familiar to .NET developers, making it easier to use & learn.
  2. Increase compatibility with .NET testing frameworks, using interfaces where possible.
  3. Support new .NET Technologies (LINQ & Reactive Framework).

As of this weeks “EA2” release we’ve addressed this by adding a new namespace and a new assembly.

image

To maintain backwards compatibility, the old API still exists in it’s original namespace, while all the new functionality lives in the new namespace; MyChannels.Nirvana where functionality is surfaced using concepts common to .NET developers; Properties, Events, Enumerable Sequences & Disposable objects. For all the developers already using .NET 4.0, support for Observable Sequences & Reactive Framework is made available by referencing Nirvana.Reactive.dll.

Getting started

To get started, create a new project and reference the Nirvana DotNet assembly. By default this is installed to C:\Nirvana 6.0.7871\dotnet\bin.

image

Then in code, create a session to the realm.

using System; 
using MyChannels.Nirvana; 

namespace ConsoleApplication42 
{ 
    class Program 
    { 
        static void Main() 
        { 
            using (var session = new Session("nsp://localhost")) 
            { 
                session.Initialize(); 
                Console.WriteLine("Connected!"); 
            } 
            Console.WriteLine("Disconnected!"); 
        } 
    } 
} 

Once initialized, a session object allows you to publish or consume events using any of Nirvana’s messaging constructs.

image

Coming up

Stay tuned! Over the coming days I’ll be diving into the different sub systems in the API.

PS. I welcome any feedback or criticisms.

Comments