static void Main(string[] args) { var bookingStream = new BookingStream(); var bookingConsumer = new BookingConsumer(bookingStream, Console.WriteLine); bookingStream.Subscribe("Subscriber1", (m) => Console.WriteLine($"Subscriber1 Message : {m.Message}")); bookingStream.Subscribe("Subscriber2", (m) => Console.WriteLine($"Subscriber2 Message Formatted : {m.Message.Substring(0, 2)}")); bookingConsumer.Listen(); // WithObserver(); //// WithoutRxExtension(); //// WithLambda(); //// WithExtension(); //// WithReplaySubject(); //// WithBehaviourSubject(); //// WithAsyncSubject(); //WithObservable(); //// Factories(); //// Blocking(); //// NonBlocking(); ////OperatorsReturn(); Console.ReadKey(); }
static void Main(string[] args) { var bookingStrem = new BookingStream(); var bookingConsumer = new BookingConsumer(bookingStrem); bookingStrem.Subscribe("sub1", (m) => Console.WriteLine($"sub1 message: {m.Message}")); //bookingStrem.Subscribe("sub2", (m) => Console.WriteLine($"sub2 message: {m.Message}")); bookingConsumer.Listen(); }