Beispiel #1
0
        internal static SqlMessagePump StartNew(Guid subscriptionId, DateTimeOffset from, SqlMessageQueueConfiguration configuration, IObserver <IMessageDescriptor> observer)
        {
            Contract.Requires(configuration != null);
            Contract.Requires(observer != null);
            Contract.Ensures(Contract.Result <SqlMessagePump>() != null);

            var messagePump = new SqlMessagePump(subscriptionId, from, configuration, observer);

            messagePump.Start();
            return(messagePump);
        }
Beispiel #2
0
 /// <summary>
 /// Subscribes to the message stream.
 /// </summary>
 /// <param name="observer">The <see cref="IObserver{T}"/> that receives messages from the stream.</param>
 /// <param name="from">The <see cref="DateTimeOffset">date and time</see> in which to begin receiving messages from.</param>
 /// <returns>A <see cref="IDisposable">disposable</see> object that can be used to the terminate the subscription.</returns>
 public virtual IDisposable Subscribe(IObserver <IMessageDescriptor> observer, DateTimeOffset from) => SqlMessagePump.StartNew(SubscriptionId, from, Configuration, observer);