Exemple #1
0
        internal static MessagePump StartNew(BlockingCollection <IMessageDescriptor> messages, IObserver <IMessageDescriptor> observer)
        {
            Contract.Requires(messages != null);
            Contract.Requires(observer != null);
            Contract.Ensures(Contract.Result <MessagePump>() != null);

            var messagePump = new MessagePump(messages, observer);

            messagePump.Start();
            return(messagePump);
        }
Exemple #2
0
 public IDisposable Subscribe(IObserver <IMessageDescriptor> observer) => MessagePump.StartNew(messages, observer);