Here are the examples of the csharp api class System.Collections.Concurrent.BlockingCollection.Dispose() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
77 Examples
0
1. Example
Project: memcache-driver
Source File: NodeQueueMock.cs
Source File: NodeQueueMock.cs
public void Dispose() { _queue.Dispose(); }
0
2. Example
Project: EnyimMemcached2
Source File: NodeQueue.cs
Source File: NodeQueue.cs
public void Dispose() { queue.Dispose(); }
0
3. Example
Project: EventFlow
Source File: RabbitMqConsumer.cs
Source File: RabbitMqConsumer.cs
public void Dispose() { _eventingBasicConsumer.Received -= OnReceived; _model.Dispose(); _connection.Dispose(); _receivedMessages.Dispose(); }
0
4. Example
Project: Toxy
Source File: ImageCache.cs
Source File: ImageCache.cs
public virtual void Dispose() { if (imageQueue != null) { imageQueue.Dispose(); } }
0
5. Example
Project: kino
Source File: AsyncQueue.cs
Source File: AsyncQueue.cs
public void Dispose() => asyncResponses.Dispose();
0
6. Example
Project: Easy.Common
Source File: ProducerConsumerQueue.cs
Source File: ProducerConsumerQueue.cs
public void Dispose() { _queue?.Dispose(); }
0
7. Example
Project: PSParallel
Source File: PowershellPool.cs
Source File: PowershellPool.cs
public void Dispose() { Streams.Dispose(); _availablePoolMembers.Dispose(); }
0
8. Example
Project: rudymq
Source File: InputChannelListener.cs
Source File: InputChannelListener.cs
protected override void OnClose(TimeSpan timeout) { this.channelQueue.Dispose(); }
0
9. Example
Project: CodeJam
Source File: ParallelQueue.cs
Source File: ParallelQueue.cs
private void Dispose(bool disposing) { if (disposing) _queue.Dispose(); }
0
10. Example
Project: inVtero.net
Source File: FileLoader.cs
Source File: FileLoader.cs
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { if (HDB != null) HDB.Dispose(); if (ReadyQueue != null) ReadyQueue.Dispose(); HDB = null; ReadyQueue = null; } disposedValue = true; } }
0
11. Example
Project: ShareX
Source File: ImageCache.cs
Source File: ImageCache.cs
public virtual void Dispose() { if (imageQueue != null) { imageQueue.Dispose(); } }
0
12. Example
Project: EventBus
Source File: OrderedEventBus.cs
Source File: OrderedEventBus.cs
protected virtual void Dispose(bool disposing) { if (!_isDisposed) { if (disposing) { _eventQueue.Dispose(); } _isDisposed = true; } }
0
13. Example
Project: AsyncEx.Context
Source File: AsyncContext.TaskQueue.cs
Source File: AsyncContext.TaskQueue.cs
public void Dispose() { _queue.Dispose(); }
0
14. Example
Project: ShareX
Source File: ImageCache.cs
Source File: ImageCache.cs
public virtual void Dispose() { if (imageQueue != null) { imageQueue.Dispose(); } }
0
15. Example
Project: Gwupe
Source File: BlockingStream.cs
Source File: BlockingStream.cs
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { _blocks.Dispose(); } }
0
16. Example
Project: NugetCracker
Source File: ConsoleDispatcher.cs
Source File: ConsoleDispatcher.cs
protected virtual void Dispose(bool disposing) { if (disposing) { if (_keyBuffer != null) { _keyBuffer.Dispose(); } if (_cancelWaitKeySource != null) { _cancelWaitKeySource.Dispose(); } } }
0
17. Example
Project: revenj
Source File: PostgresConnectionPool.cs
Source File: PostgresConnectionPool.cs
public void Dispose() { try { foreach (var con in Connections) { try { con.Close(); } catch (Exception ex) { TraceSource.TraceEvent(TraceEventType.Error, 5013, "{0}", ex); } } Connections.Dispose(); NpgsqlConnection.ClearAllPools(); } catch (Exception e) { TraceSource.TraceEvent(TraceEventType.Error, 5014, "{0}", e); } }
0
18. Example
Project: revenj
Source File: ScopePool.cs
Source File: ScopePool.cs
public void Dispose() { try { foreach (var s in Scopes) { try { Queries.EndQuery(s.Query, false); s.Factory.Dispose(); } catch (Exception ex) { TraceSource.TraceEvent(TraceEventType.Error, 5303, "{0}", ex); } } Scopes.Dispose(); } catch (Exception ex2) { TraceSource.TraceEvent(TraceEventType.Error, 5304, "{0}", ex2); } }
0
19. Example
Project: Lean
Source File: BusyBlockingCollection.cs
Source File: BusyBlockingCollection.cs
public void Dispose() { _collection.Dispose(); _processingCompletedEvent.Dispose(); }
0
20. Example
Project: Lean
Source File: EnqueueableEnumerator.cs
Source File: EnqueueableEnumerator.cs
public void Dispose() { lock (_lock) { if (_disposed) return; Stop(); if (_blockingCollection != null) _blockingCollection.Dispose(); _disposed = true; } }
0
21. Example
Project: QDMS
Source File: ContinuousFuturesBroker.cs
Source File: ContinuousFuturesBroker.cs
public void Dispose() { if (_reconnectTimer != null) _reconnectTimer.Dispose(); if (_client != null) { _client.Dispose(); _client = null; } if (_frontContractRequests != null) _frontContractRequests.Dispose(); }
0
22. Example
Project: NuGet
Source File: ConsoleDispatcher.cs
Source File: ConsoleDispatcher.cs
protected virtual void Dispose(bool disposing) { if (disposing) { if (_keyBuffer != null) { _keyBuffer.Dispose(); } if (_cancelWaitKeySource != null) { _cancelWaitKeySource.Dispose(); } } }
0
23. Example
Project: CANAPE.Core
Source File: LockedQueue.cs
Source File: LockedQueue.cs
void IDisposable.Dispose() { _queue.Dispose(); GC.SuppressFinalize(this); }
0
24. Example
Project: oleviewdotnet
Source File: LockedQueue.cs
Source File: LockedQueue.cs
void IDisposable.Dispose() { _queue.Dispose(); GC.SuppressFinalize(this); }
0
25. Example
Project: CloudFS
Source File: ProducerConsumerStream.cs
Source File: ProducerConsumerStream.cs
protected override void Dispose(bool disposing) { if (disposing) blocks.Dispose(); base.Dispose(disposing); }
0
26. Example
Project: NuTracer
Source File: TracerManager.cs
Source File: TracerManager.cs
public void Dispose() { cancellation.Cancel(); traceQueue.Dispose(); }
0
27. Example
Project: NosDB
Source File: RecoveryPersistenceQueue.cs
Source File: RecoveryPersistenceQueue.cs
public void Dispose() { try { if (documentCollection != null) { documentCollection.Dispose(); } if (_cancelToken != null) _cancelToken.Dispose(); } catch (Exception exp) { if (LoggerManager.Instance.RecoveryLogger != null && LoggerManager.Instance.RecoveryLogger.IsErrorEnabled) LoggerManager.Instance.RecoveryLogger.Error("RecoveryPersistenceQueue.Dispose()", exp.ToString()); } }
0
28. Example
Project: NLog.Targets.Syslog
Source File: AsyncLogger.cs
Source File: AsyncLogger.cs
public void Dispose() { cts.Cancel(); cts.Dispose(); queue.Dispose(); buffer.Dispose(); messageTransmitter.Dispose(); }
0
29. Example
Project: waf
Source File: UnitTestSynchronizationContext.cs
Source File: UnitTestSynchronizationContext.cs
private void Dispose(bool isDisposing) { if (isDisposed) { return; } isDisposed = true; if (isDisposing) { FinishMessageQueue(); messageQueue.Dispose(); SetSynchronizationContext(previousContext); } }
0
30. Example
Project: QDMS
Source File: RealTimeDataBroker.cs
Source File: RealTimeDataBroker.cs
public void Dispose() { if (_cfBroker != null) { _cfBroker.Dispose(); _cfBroker = null; } if (_connectionTimer != null) { _connectionTimer.Dispose(); _connectionTimer = null; } foreach(var dataSource in DataSources.Where(ds => ds.Value is IDisposable)) { ((IDisposable)dataSource.Value).Dispose(); } /*if (DataSources.ContainsKey("Interactive Brokers")) { ((IB)DataSources["Interactive Brokers"]).Dispose(); }*/ if (_arrivedBars != null) _arrivedBars.Dispose(); }
0
31. Example
Project: FabricTableService
Source File: PersistentTablePool.cs
Source File: PersistentTablePool.cs
public void Dispose() { this.pool.CompleteAdding(); this.pool.Dispose(); PersistentTable<TKey, TValue> table; while (this.allInstances.TryTake(out table)) { table.Dispose(); } var instance = this.Instance; if (instance == null) { return; } instance.TermGrbit = TermGrbit.Complete; instance.Term(); instance.Dispose(); this.Instance = null; }
0
32. Example
Project: Rubberduck
Source File: StaTaskScheduler.cs
Source File: StaTaskScheduler.cs
public void Dispose() { if (_tasks != null) { _tasks.CompleteAdding(); foreach (var thread in _threads) { thread.Join(); } _tasks.Dispose(); _tasks = null; } }
0
33. Example
Project: microsoft-authentication-library-for-dotnet
Source File: StaTaskScheduler.cs
Source File: StaTaskScheduler.cs
public void Dispose() { if (_tasks != null) { // Indicate that no new tasks will be coming in _tasks.CompleteAdding(); // Wait for all threads to finish processing tasks foreach (var thread in _threads) thread.Join(); // Cleanup _tasks.Dispose(); _tasks = null; } }
0
34. Example
Project: azure-activedirectory-library-for-dotnet
Source File: StaTaskScheduler.cs
Source File: StaTaskScheduler.cs
public void Dispose() { if (_tasks != null) { // Indicate that no new tasks will be coming in _tasks.CompleteAdding(); // Wait for all threads to finish processing tasks foreach (var thread in _threads) thread.Join(); // Cleanup _tasks.Dispose(); _tasks = null; } }
0
35. Example
Project: msgpack-rpc-cli
Source File: InProcServerTransportManager.cs
Source File: InProcServerTransportManager.cs
protected sealed override void Dispose( bool disposing ) { if ( !this._cancellationTokenSource.IsCancellationRequested ) { this._cancellationTokenSource.Cancel(); } this._cancellationTokenSource.Dispose(); foreach ( var entry in this._arrivedQueueTable ) { var queue = entry.Value; if ( queue != null ) { queue.Dispose(); } } foreach ( var entry in this._receivingQueueTable ) { var queue = entry.Value; if ( queue != null ) { queue.Dispose(); } } base.Dispose( disposing ); }
0
36. Example
Project: carbonator
Source File: CarbonatorInstance.cs
Source File: CarbonatorInstance.cs
public static void StopCollection() { if (!_started) return; _started = false; _metricCollectorTimer.Dispose(); _metricReporterTimer.Dispose(); if (_tcpClient != null && _tcpClient.Connected) _tcpClient.Close(); foreach (var watcher in _watchers) { watcher.Dispose(); } _watchers.Clear(); _metricsList.Dispose(); }
0
37. Example
Project: hazelcast-csharp-client
Source File: StripedTaskScheduler.cs
Source File: StripedTaskScheduler.cs
public void Dispose() { if (_tasks != null) { // Indicate that no new tasks will be coming in foreach (var task in _tasks) { task.Value.CompleteAdding(); } // Wait for all threads to finish processing tasks foreach (var thread in _threads) thread.Join(); // Cleanup foreach (var task in _tasks) { task.Value.Dispose(); } _tasks = null; _threads.Clear(); } }
0
38. Example
Project: kino
Source File: MessageHub.cs
Source File: MessageHub.cs
private void SendClientRequests(CancellationToken token) { try { /n ..... /n //View Source file for more details /n }
0
39. Example
Project: kino
Source File: ScaleOutListener.cs
Source File: ScaleOutListener.cs
public void Stop() { cancellationTokenSource?.Cancel(); listening?.Wait(); receiptConfirmation?.Wait(); cancellationTokenSource?.Dispose(); receiptConfirmationQueue?.Dispose(); }
0
40. Example
Project: StarryEyes
Source File: StreamWinder.cs
Source File: StreamWinder.cs
private static void StartParserWorker([NotNull] BlockingCollection<string> collection, [NotNull] Action<string> parser, CancellationToken token) { if (collection == null) throw new ArgumentNullException(nameof(collection)); if (parser == null) throw new ArgumentNullException(nameof(parser)); const TaskCreationOptions option = TaskCreationOptions.DenyChildAttach | TaskCreationOptions.LongRunning; Task.Factory.StartNew(() => { try { foreach (var item in collection.GetConsumingEnumerable(token)) { parser(item); } } finally { collection.Dispose(); } }, token, option, TaskScheduler.Default); }
0
41. Example
Project: echo-process
Source File: PausableBlockingQueue.cs
Source File: PausableBlockingQueue.cs
public void Dispose() { Cancel(); tokenSource?.Dispose(); pauseWait?.Dispose(); items?.Dispose(); }
0
42. Example
Project: echo-process
Source File: PausableBlockingQueue.cs
Source File: PausableBlockingQueue.cs
public void Dispose() { Cancel(); tokenSource?.Dispose(); pauseWait?.Dispose(); items?.Dispose(); }
0
43. Example
Project: journeyofcode
Source File: SingleThreadTaskScheduler.cs
Source File: SingleThreadTaskScheduler.cs
private void ThreadStart() { try { var token = this._cancellationToken.Token; this._initAction(); foreach (var task in this._tasks.GetConsumingEnumerable(token)) this.TryExecuteTask(task); } finally { this._tasks.Dispose(); } }
0
44. Example
Project: ServiceBusExplorer
Source File: PartitionListenerControl.cs
Source File: PartitionListenerControl.cs
protected override void Dispose(bool disposing) { try { if (disposing && (components != null)) { components.Dispose(); } if (eventDataCollection != null) { eventDataCollection.Dispose(); } //if (cancellationTokenSource != null) //{ // cancellationTokenSource.Dispose(); //} if (receiverEventDataInspector != null) { var disposable = receiverEventDataInspector as IDisposable; if (disposable != null) { disposable.Dispose(); } } for (var i = 0; i < Controls.Count; i++) { Controls[i].Dispose(); } base.Dispose(disposing); } // ReSharper disable once EmptyGeneralCatchClause catch { } }
0
45. Example
Project: ServiceBusExplorer
Source File: ContainerForm.cs
Source File: ContainerForm.cs
private void StartLog() { if (logCollection != null) { logCollection.Dispose(); } logCollection = new BlockingCollection<string>(); cancellationTokenSource = new CancellationTokenSource(); logTask = Task.Factory.StartNew(AsyncWriteToLog).ContinueWith(t => { if (t.IsFaulted && t.Exception != null) { WriteToLog(t.Exception.Message); } }); }
0
46. Example
Project: ServiceBusExplorer
Source File: MainForm.cs
Source File: MainForm.cs
private void StartLog() { if (logCollection != null) { logCollection.Dispose(); } logCollection = new BlockingCollection<string>(); cancellationTokenSource = new CancellationTokenSource(); logTask = Task.Factory.StartNew(AsyncWriteToLog).ContinueWith(t => { if (t.IsFaulted && t.Exception != null) { WriteToLog(t.Exception.Message); } }); }
0
47. Example
Project: ACDDokanNet
Source File: UploadService.cs
Source File: UploadService.cs
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { Stop(); cancellation.Dispose(); uploadLimitSemaphore.Dispose(); leftUploads.Dispose(); } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }
0
48. Example
Project: RampUp
Source File: RoundRobinThreadAffinedTaskScheduler.cs
Source File: RoundRobinThreadAffinedTaskScheduler.cs
public void Dispose() { if (_tasks != null) { _tasks.CompleteAdding(); _threads.ForEach(t => t.Join()); _tasks.Dispose(); _tasks = null; } }
0
49. Example
Project: inVtero.net
Source File: CloudLoader.cs
Source File: CloudLoader.cs
public void QueryHashes(HashRecord[] hashArr) { ParallelOptions po = new Paralle/n ..... /n //View Source file for more details /n }
0
50. Example
Project: Harvester
Source File: MessageProcessor.cs
Source File: MessageProcessor.cs
public void Dispose() { lock (syncLock) { if (cancellationTokenSource.IsCancellationRequested) return; cancellationTokenSource.Cancel(); processor.Join(); cancellationTokenSource.Dispose(); messageQueue.Dispose(); } }