// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT License. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Threading.Tasks; namespace System.Reactive.Joins { public abstract class AsyncPlan { internal AsyncPlan() { } internal abstract ActiveAsyncPlan Activate(Dictionary externalSubscriptions, IAsyncObserver observer, Func deactivate); internal static AsyncJoinObserver CreateObserver(Dictionary externalSubscriptions, IAsyncObservable observable, Func onError) { var res = default(AsyncJoinObserver); if (externalSubscriptions.TryGetValue(observable, out var joinObserver)) { res = (AsyncJoinObserver)joinObserver; } else { res = new AsyncJoinObserver(observable, onError); externalSubscriptions.Add(observable, res); } return res; } } }