Exemple #1
0
        public override void Dispose()
        {
            TrashCan.Throw(ref dataReader);
            TrashCan.Throw(ref command);

            base.Dispose();
        }
Exemple #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());
 }
Exemple #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();
        }
Exemple #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());
     });
 }
Exemple #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);
        }
Exemple #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);
        }
Exemple #10
0
 public override void Dispose()
 {
     TrashCan.Throw(ref flushSemaphore);
     base.Dispose();
 }
Exemple #11
0
 public void Dispose()
 {
     TrashCan.Throw(ref dataProvider);
 }
Exemple #12
0
 public void Dispose()
 {
     TrashCan.Throw(ref random);
 }
Exemple #13
0
 public void Dispose()
 {
     TrashCan.Throw(ref reader);
 }
Exemple #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);
 }
Exemple #17
0
 public override void Stop()
 {
     base.Stop();
     TrashCan.Throw(ref errorLogWriter);
     TrashCan.Throw(ref errorLogStream);
 }
Exemple #18
0
 public void Dispose()
 {
     TrashCan.Throw(ref batchCursor);
     TrashCan.Throw(ref asyncCursor);
 }
Exemple #19
0
 public virtual void Dispose()
 {
     TrashCan.Throw(ref chunkCursor);
 }
 public void Dispose()
 {
     TrashCan.Throw(ref documentsCursor);
 }
 public void Dispose()
 {
     TrashCan.Throw(ref file);
 }
Exemple #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());
 }
Exemple #26
0
 public override void Dispose()
 {
     TrashCan.Throw(ref documentsCursor);
     base.Dispose();
 }
Exemple #27
0
 public void Dispose()
 {
     TrashCan.Throw(ref client);
 }
Exemple #28
0
 private void RequestNextChunk()
 {
     TrashCan.Throw(ref chunkCursor);
     chunkDownloadTask = documentQuery.ExecuteNextAsync <TIn>();
 }