IResourceLoader: Balancing Semaphores

added by tdupont
8/30/2016 6:32:34 AM

1 Kicks, 230 Views

Recently I need to balance getting resources from a restricted number of sources. To do this I created a generic IResourceLoader interface, and made two implementations: one to wrap a semaphore, and the other to wrap and balance a collection of IResourceLoaders. Below is the implementation, complete with unit tests; let's take a look!