예제 #1
0
 public Pipe Notify(IMessage message, ISubScriber subscriber)
 {
     if (message == null || subscriber == null)
     {
         return null;
     }
     Pipe pipe = new Pipe(message, subscriber);
     pipe.SendMessage();
     return pipe;
 }
예제 #2
0
 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;
 }