public override void Dispose() { TrashCan.Throw(ref dataReader); TrashCan.Throw(ref command); base.Dispose(); }
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()); }
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(); }
/// <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()); }); }
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); }
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); }
public override void Dispose() { TrashCan.Throw(ref flushSemaphore); base.Dispose(); }
public void Dispose() { TrashCan.Throw(ref dataProvider); }
public void Dispose() { TrashCan.Throw(ref random); }
public void Dispose() { TrashCan.Throw(ref reader); }
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); }
public override void Stop() { base.Stop(); TrashCan.Throw(ref errorLogWriter); TrashCan.Throw(ref errorLogStream); }
public void Dispose() { TrashCan.Throw(ref batchCursor); TrashCan.Throw(ref asyncCursor); }
public virtual void Dispose() { TrashCan.Throw(ref chunkCursor); }
public void Dispose() { TrashCan.Throw(ref documentsCursor); }
public void Dispose() { TrashCan.Throw(ref file); }
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()); }
public override void Dispose() { TrashCan.Throw(ref documentsCursor); base.Dispose(); }
public void Dispose() { TrashCan.Throw(ref client); }
private void RequestNextChunk() { TrashCan.Throw(ref chunkCursor); chunkDownloadTask = documentQuery.ExecuteNextAsync <TIn>(); }