Пример #1
0
        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;
        }
Пример #2
0
 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;
 }
Пример #4
0
 public AsyncLoader(IResourceLoader loader, IAsyncExecutor executor)
 {
     this.loader   = loader;
     this.executor = executor;
 }
Пример #5
0
 public AcquireJobsCmd(IAsyncExecutor asyncExecutor)
 {
     this.asyncExecutor = asyncExecutor;
 }
Пример #6
0
 public AsyncStubFiber(IAsyncExecutor executor = null, IAsyncFiberScheduler scheduler = null)
     : base(executor, scheduler)
 {
 }
Пример #7
0
 public SchedulersManager(IAsyncExecutor executorAsyncQuery) => (_executorAsyncQuery) = (executorAsyncQuery);
Пример #8
0
 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;
 }
Пример #12
0
 public TestingService(IExternalSleepyService sleepy, IRandomService randomService, IFactoryTestingModel factoryTestingModel, IFactoryException factoryException, IAsyncExecutor asyncExecutor)
 {
     Sleepy              = sleepy;
     RandomService       = randomService;
     FactoryTestingModel = factoryTestingModel;
     FactoryException    = factoryException;
     AsyncExecutor       = asyncExecutor;
 }
Пример #13
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="asyncExecutor"></param>
        public AcquireAsyncJobsDueRunnable(IAsyncExecutor asyncExecutor)
        {
            this.asyncExecutor = asyncExecutor;

            this.Runable += new ThreadStart(Run);
        }
Пример #14
0
 public ExternalSleepyService(IAsyncExecutor asyncExecutor)
 {
     AsyncExecutor = asyncExecutor;
 }
 public CollectionResourceQueryProvider(IAsyncExecutor <TResult> executor)
 {
     this.executor = executor;
 }
Пример #16
0
 public SyncScalarExecutor(IAsyncExecutor <TItem> executor, Expression expression)
 {
     this.executor = new CollectionResourceExecutor <TItem>(executor, expression);
 }
Пример #17
0
 public AsyncJobAddedNotification(IJobEntity job, IAsyncExecutor asyncExecutor)
 {
     this.job           = job;
     this.asyncExecutor = asyncExecutor;
 }