/// <summary> /// Converts a reliable observable sequence to a subscribable sequence which checkpoints the received elements using their sequence numbers. /// </summary> /// <typeparam name="T">Type of the elements received by the source sequence.</typeparam> /// <param name="source">Reliable observable sequence to convert to a subscribable sequence.</param> /// <returns>Subscribable sequence wrapping the specified reliable observable.</returns> public static ISubscribable <T> ToSubscribable <T>(this IReliableObservable <T> source) => source.ToSubscribable(switchContext: false);
/// <summary> /// Converts a reliable observable sequence to a subscribable sequence which checkpoints the received elements using their sequence numbers, optionally specifying context switching behavior. /// </summary> /// <typeparam name="T">Type of the elements received by the source sequence.</typeparam> /// <param name="source">Reliable observable sequence to convert to a subscribable sequence.</param> /// <param name="switchContext">If set to <c>true</c>, received elements will be produced on the logical scheduler provided to subscription on the resulting subscribable sequence via the SetContext call. Otherwise, elements are produced in a free-threaded manner.</param> /// <returns>Subscribable sequence wrapping the specified reliable observable.</returns> public static ISubscribable <T> ToSubscribable <T>(this IReliableObservable <T> source, bool switchContext) => new ReliableSubscriptionInput <T>(source, switchContext);
/// <summary> /// Creates a new reliable observable converter. /// </summary> /// <param name="source">The reliable observable to subscribe to.</param> /// <param name="switchContext">true if events need to be context switched into the engine via the scheduler; otherwise, false.</param> public ReliableSubscriptionInput(IReliableObservable <T> source, bool switchContext) { _source = source; _switchContext = switchContext; }