public static DataReaderObservableRunner RunAsync(IDbCommand command, IObserver<IDictionary<string, object>> observer) { DataReaderObservableRunner instance = null; if (!RunnerCache.Contains(command)) { instance = CreateInstance(command, observer); } if (instance == null) instance = new CachedRunner(RunnerCache.Get(command), observer); var asyncAction = new Action(instance.Run); asyncAction.BeginInvoke(asyncAction.EndInvoke, null); return instance; }
public static DataReaderObservableRunner RunAsync(IDbCommand command, IObserver <IDictionary <string, object> > observer) { DataReaderObservableRunner instance = null; if (!RunnerCache.Contains(command)) { instance = CreateInstance(command, observer); } if (instance == null) { instance = new CachedRunner(RunnerCache.Get(command), observer); } var asyncAction = new Action(instance.Run); asyncAction.BeginInvoke(asyncAction.EndInvoke, null); return(instance); }