public async Task Test3() { SetupNlog.Initialize("bla"); MappingExtensions.Mapper = new MapperConfiguration(cfg => { cfg.AddProfile <ArmaServerProfile>(); }).CreateMapper(); var f = new SteamSession.SteamSessionFactory(); var id = (uint)SteamGameIds.Arma2Oa; LockedWrapper.callFactory = new SafeCallFactory(); // workaround for accessviolation errors var c = await f.Do(id, SteamHelper.Create().SteamPath, async() => { using (var scheduler = new EventLoopScheduler()) { using (var obs2 = new Subject <ArmaServerInfoModel>()) { var s = obs2.Synchronize() .ObserveOn(scheduler) .Buffer(24) //.Do(x => Console.WriteLine("r" + x.ToList<ServerInfoModel>())) .SelectMany(x => x) .Count() .ToTask(); var c2 = await SteamServers.GetServers(f, true, ServerFilterBuilder.Build().FilterByAppId(id).FilterByDedicated().Value, obs2.OnNext) .ConfigureAwait(false); obs2.OnCompleted(); return(new BatchResult(await s)); } } }).ConfigureAwait(false); }
public async Task Test3() { SetupNlog.Initialize("bla"); MappingExtensions.Mapper = new MapperConfiguration(cfg => { cfg.AddProfile<ArmaServerProfile>(); }).CreateMapper(); var f = new SteamSession.SteamSessionFactory(); var id = (uint)SteamGameIds.Arma2Oa; LockedWrapper.callFactory = new SafeCallFactory(); // workaround for accessviolation errors var c = await f.Do(id, SteamHelper.Create().SteamPath, async () => { using (var scheduler = new EventLoopScheduler()) { using (var obs2 = new Subject<ArmaServerInfoModel>()) { var s = obs2.Synchronize() .ObserveOn(scheduler) .Buffer(24) //.Do(x => Console.WriteLine("r" + x.ToList<ServerInfoModel>())) .SelectMany(x => x) .Count() .ToTask(); var c2 = await SteamServers.GetServers(f, true, ServerFilterBuilder.Build().FilterByAppId(id).FilterByDedicated().Value, obs2.OnNext) .ConfigureAwait(false); obs2.OnCompleted(); return new BatchResult(await s); } } }).ConfigureAwait(false); }