diff options
| author | Eric Reed <ebr@mediabrowser3.com> | 2013-03-04 11:59:57 -0500 |
|---|---|---|
| committer | Eric Reed <ebr@mediabrowser3.com> | 2013-03-04 11:59:57 -0500 |
| commit | e5a78ba5bf8f0e181c9d1991ba37cb9116d32c1d (patch) | |
| tree | f03acbc59d8799f9dc861b8b77ab4334082c4503 /MediaBrowser.Common/Kernel/ResourcePool.cs | |
| parent | 62448129a66f50b6ac2874c6da514399f974340e (diff) | |
| parent | da535db6554e1ca6610f247b02b3a0391e8f1f02 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Common/Kernel/ResourcePool.cs')
| -rw-r--r-- | MediaBrowser.Common/Kernel/ResourcePool.cs | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/MediaBrowser.Common/Kernel/ResourcePool.cs b/MediaBrowser.Common/Kernel/ResourcePool.cs deleted file mode 100644 index 7a74c60a7..000000000 --- a/MediaBrowser.Common/Kernel/ResourcePool.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Threading; - -namespace MediaBrowser.Common.Kernel -{ - /// <summary> - /// This is just a collection of semaphores to control the number of concurrent executions of various resources - /// </summary> - public class ResourcePool : IDisposable - { - /// <summary> - /// You tube - /// </summary> - public readonly SemaphoreSlim YouTube = new SemaphoreSlim(5, 5); - - /// <summary> - /// The trakt - /// </summary> - public readonly SemaphoreSlim Trakt = new SemaphoreSlim(5, 5); - - /// <summary> - /// The tv db - /// </summary> - public readonly SemaphoreSlim TvDb = new SemaphoreSlim(5, 5); - - /// <summary> - /// The movie db - /// </summary> - public readonly SemaphoreSlim MovieDb = new SemaphoreSlim(5, 5); - - /// <summary> - /// The fan art - /// </summary> - public readonly SemaphoreSlim FanArt = new SemaphoreSlim(5, 5); - - /// <summary> - /// The mb - /// </summary> - public readonly SemaphoreSlim Mb = new SemaphoreSlim(5, 5); - - /// <summary> - /// The mb - /// </summary> - public readonly SemaphoreSlim Lastfm = new SemaphoreSlim(5, 5); - - /// <summary> - /// Apple doesn't seem to like too many simulataneous requests. - /// </summary> - public readonly SemaphoreSlim AppleTrailerVideos = new SemaphoreSlim(1, 1); - - /// <summary> - /// The apple trailer images - /// </summary> - public readonly SemaphoreSlim AppleTrailerImages = new SemaphoreSlim(1, 1); - - /// <summary> - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// </summary> - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// <summary> - /// Releases unmanaged and - optionally - managed resources. - /// </summary> - /// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> - protected virtual void Dispose(bool dispose) - { - if (dispose) - { - YouTube.Dispose(); - Trakt.Dispose(); - TvDb.Dispose(); - MovieDb.Dispose(); - FanArt.Dispose(); - Mb.Dispose(); - AppleTrailerVideos.Dispose(); - AppleTrailerImages.Dispose(); - } - } - } -} |
