public Pipe Notify(IMessage message, ISubScriber subscriber) { if (message == null || subscriber == null) { return null; } Pipe pipe = new Pipe(message, subscriber); pipe.SendMessage(); return pipe; }
public List<Pipe> NotifyAll(IMessage message) { List<Pipe> pipes = new List<Pipe>(); if (message == null) { return pipes; } foreach (ISubScriber subscriber in _subscribers) { Pipe pipe = new Pipe(message, subscriber); pipe.SendMessage(); pipes.Add(pipe); } return pipes; }