public IEnumerator<int> Load(IAsyncExecutor async) { WebRequest request = WebRequest.Create("http://blog.phatboyg.com/"); request.BeginGetResponse(async.End(), null); yield return 1; using (WebResponse response = request.EndGetResponse(async.Result())) { using (Stream responseStream = response.GetResponseStream()) { var blockSize = 16384; byte[] block = new byte[blockSize]; int bytesRead; do { responseStream.BeginRead(block, 0, blockSize, async.End(), null); yield return 1; bytesRead = responseStream.EndRead(async.Result()); TotalBytesRead += bytesRead; } while (bytesRead != 0); } } Completed = true; }
public async Task StartAsync(IAsyncExecutor executor) { await _workerPool.StartAsync(executor); }
public SyncCollectionEnumeratorAdapter(IAsyncExecutor <TResult> executor, CancellationToken cancellationToken = default(CancellationToken)) { this.executor = executor; this.cancellationToken = cancellationToken; }
public AsyncLoader(IResourceLoader loader, IAsyncExecutor executor) { this.loader = loader; this.executor = executor; }
public AcquireJobsCmd(IAsyncExecutor asyncExecutor) { this.asyncExecutor = asyncExecutor; }
public AsyncStubFiber(IAsyncExecutor executor = null, IAsyncFiberScheduler scheduler = null) : base(executor, scheduler) { }
public SchedulersManager(IAsyncExecutor executorAsyncQuery) => (_executorAsyncQuery) = (executorAsyncQuery);
protected AsyncFiberBase(IAsyncExecutor executor = null, IAsyncFiberScheduler scheduler = null) { _fiberScheduler = scheduler ?? new AsyncTimerScheduler(); Executor = executor ?? new AsyncExecutor(); }
private CollectionResourceQueryable(IAsyncExecutor <TResult> executor) { this.expression = Expression.Constant(this); this.executor = executor; this.queryProvider = new CollectionResourceQueryProvider <TResult>(this.executor); }
public CollectionResourceQueryable(string collectionHref, IInternalDataStore dataStore) { this.expression = Expression.Constant(this); this.executor = new CollectionResourceExecutor <TResult>(collectionHref, dataStore, this.expression); this.queryProvider = new CollectionResourceQueryProvider <TResult>(this.executor); }
/// <summary> /// /// </summary> /// <param name="asyncExecutor"></param> /// <param name="tenantInfoHolder"></param> /// <param name="tenantId"></param> public TenantAwareAcquireAsyncJobsDueRunnable(IAsyncExecutor asyncExecutor, ITenantInfoHolder tenantInfoHolder, string tenantId) : base(asyncExecutor) { this.tenantInfoHolder = tenantInfoHolder; this.tenantId = tenantId; }
public TestingService(IExternalSleepyService sleepy, IRandomService randomService, IFactoryTestingModel factoryTestingModel, IFactoryException factoryException, IAsyncExecutor asyncExecutor) { Sleepy = sleepy; RandomService = randomService; FactoryTestingModel = factoryTestingModel; FactoryException = factoryException; AsyncExecutor = asyncExecutor; }
/// <summary> /// /// </summary> /// <param name="asyncExecutor"></param> public AcquireAsyncJobsDueRunnable(IAsyncExecutor asyncExecutor) { this.asyncExecutor = asyncExecutor; this.Runable += new ThreadStart(Run); }
public ExternalSleepyService(IAsyncExecutor asyncExecutor) { AsyncExecutor = asyncExecutor; }
public CollectionResourceQueryProvider(IAsyncExecutor <TResult> executor) { this.executor = executor; }
public SyncScalarExecutor(IAsyncExecutor <TItem> executor, Expression expression) { this.executor = new CollectionResourceExecutor <TItem>(executor, expression); }
public AsyncJobAddedNotification(IJobEntity job, IAsyncExecutor asyncExecutor) { this.job = job; this.asyncExecutor = asyncExecutor; }