paulogenargue / pub-sub-sample

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pub-Sub Sample

This dotnet core project contains a simple implementation of an in-memory pub-sub pattern (PubSubSample.Messaging) and a sample application that uses the messaging library.

The Messaging Library

In this library, we have generic interfaces for publisher and subscription (IPublisher<T> and ISubscription<T>). In this design, the Type T determines the relationship between these two. This means published T1 messages will be received by subscribers of a T1 message but not by subscribers of a T2 message.

The Sample App

The sample application (PubSubSample.SampleApp) accepts first name and last name, then displays two different formats of the complete name. Its usage of the PubSubSample.Messaging library is as follows:

  • When the name is read from console, a Name object is published.
  • A display object is subscribed to the Name message and displays it in different formats once received.

About


Languages

Language:C# 100.0%