Пример #1
0
        public override void Dispose()
        {
            TrashCan.Throw(ref dataReader);
            TrashCan.Throw(ref command);

            base.Dispose();
        }
Пример #2
0
 public void Dispose()
 {
     lock (cleanupLock)
     {
         TrashCan.Throw(ref tokenSource);
     }
 }
 public void Dispose()
 {
     TrashCan.Throw(ref jsonWriter, w =>
     {
         w.WriteEndArray();
         w.Close();
     });
     TrashCan.Throw(ref streamWriter, w => w.Close());
     TrashCan.Throw(ref fileStream, s => s.Close());
 }
Пример #4
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (!disposing)
            {
                return;
            }

            TrashCan.Throw(ref innerStream);
        }
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (!disposing)
            {
                return;
            }

            TrashCan.Throw(ref response, r => r.Close());
        }
        public override void Dispose()
        {
            var adapters = Interlocked.Exchange(ref dataAdapters, null);

            if (adapters != null)
            {
                foreach (var adapter in adapters.Values)
                {
                    var adapterCopy = adapter;
                    TrashCan.Throw(ref adapterCopy);
                }
            }

            base.Dispose();
        }
Пример #7
0
 /// <summary>
 /// Releases all resources.
 /// </summary>
 public void Dispose()
 {
     TrashCan.Throw(ref adapters, a =>
     {
         do
         {
             try
             {
                 if (a.Current != null)
                 {
                     a.Current.Dispose();
                 }
             } catch { }
         } while (a.MoveNext());
     });
 }
Пример #8
0
        private async Task <bool> MoveToNextBatch(CancellationToken cancellation)
        {
            while (await asyncCursor.MoveNextAsync(cancellation))
            {
                TrashCan.Throw(ref batchCursor);

                if (asyncCursor.Current == null)
                {
                    continue;
                }

                batchCursor = asyncCursor.Current.GetEnumerator();

                if (batchCursor.MoveNext())
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #9
0
        private async Task <IEnumerator <TIn> > GetCurrentChunkCursor()
        {
            if (chunkCursor == null)
            {
                chunkCursor = (await chunkDownloadTask).GetEnumerator();

                // New chunk: adjust to first record to make sure that there is data to read, if not - request next one
                var hasData = false;
                while (!(hasData = chunkCursor.MoveNext()) && documentQuery.HasMoreResults)
                {
                    RequestNextChunk();
                    chunkCursor = (await chunkDownloadTask).GetEnumerator();
                }

                completed = !hasData;
                if (completed)
                {
                    TrashCan.Throw(ref chunkCursor);
                }
            }

            return(chunkCursor);
        }
Пример #10
0
 public override void Dispose()
 {
     TrashCan.Throw(ref flushSemaphore);
     base.Dispose();
 }
Пример #11
0
 public void Dispose()
 {
     TrashCan.Throw(ref dataProvider);
 }
Пример #12
0
 public void Dispose()
 {
     TrashCan.Throw(ref random);
 }
Пример #13
0
 public void Dispose()
 {
     TrashCan.Throw(ref reader);
 }
Пример #14
0
 public override void Stop()
 {
     base.Stop();
     TrashCan.Throw(ref errorLogSynchronizedWriter);
     TrashCan.Throw(ref errorLogStreamWriter);
 }
 public void Dispose()
 {
     TrashCan.Throw(ref rowsCursor);
 }
 public void Dispose()
 {
     TrashCan.Throw(ref currentScope);
 }
Пример #17
0
 public override void Stop()
 {
     base.Stop();
     TrashCan.Throw(ref errorLogWriter);
     TrashCan.Throw(ref errorLogStream);
 }
Пример #18
0
 public void Dispose()
 {
     TrashCan.Throw(ref batchCursor);
     TrashCan.Throw(ref asyncCursor);
 }
Пример #19
0
 public virtual void Dispose()
 {
     TrashCan.Throw(ref chunkCursor);
 }
 public void Dispose()
 {
     TrashCan.Throw(ref documentsCursor);
 }
 public void Dispose()
 {
     TrashCan.Throw(ref file);
 }
Пример #22
0
 private void RequestNextChunk(CancellationToken cancellation)
 {
     TrashCan.Throw(ref chunkCursor);
     chunkDownloadTask = documentQuery.ExecuteNextAsync <TIn>(cancellation);
 }
 public void Dispose()
 {
     TrashCan.Throw(ref enumerator);
 }
        public void Dispose()
        {
            Disposed = true;

            TrashCan.Throw(ref batches);
        }
 public void Dispose()
 {
     TrashCan.Throw(ref jsonReader, r => r.Close());
     TrashCan.Throw(ref file, f => f.Close());
 }
Пример #26
0
 public override void Dispose()
 {
     TrashCan.Throw(ref documentsCursor);
     base.Dispose();
 }
Пример #27
0
 public void Dispose()
 {
     TrashCan.Throw(ref client);
 }
Пример #28
0
 private void RequestNextChunk()
 {
     TrashCan.Throw(ref chunkCursor);
     chunkDownloadTask = documentQuery.ExecuteNextAsync <TIn>();
 }