Project Description
This is a new implementation of Publisher/Subscriber pattern, in this implementation the message is not a string, instead its a specific model T.

You can subscribe on an specific event with specific event argument type and also you can specify a condition/expression for the event argument, so the expression will execute in the publishing side and the message will publish to the subscribers with matching condition not all of them. So when you use this library in WCF mode the subscribers can choose witch messages they want with a condition expression and the conditions will execute against messages on the server side(publishing server).

Subscription example :
        public class MySubscriber : ISubscriber<Person>
            WCFSubscriptionService srv;
            public MySubscriber()
                srv = new WCFSubscriptionService();
                srv.Subscribe<Person>("Exit", this, (p => p.Age >= 12));

            public void OnTopicPublished(string topicName, Person args)
                // do something here

MySubscriber subscribes it self for Exit event with Person message type and Age>=12 condition.

Publishing example :
            PublishingService pub = new PublishingService();
            pub.Publish<Person>("Exit", new Person() { Name = "Bashir", Age = 26 });

With these 2 lines of code you can publish Exit event and pass a Person as argument ,

I have implemented WCF support for this library too, you can host a pubsub server then publishers and subscribers can simply connect to the server and do their works.
I have used CallBackChannel for publishing so we have transient subscribers not persistent subscribers.

Last edited Oct 17, 2013 at 3:01 PM by Basir_ansary, version 4